@slotted/react 0.1.0-beta.1 → 0.1.0-beta.2

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 (91) hide show
  1. package/README.md +4 -0
  2. package/dist/{action-sheet-D8Glxl7l.js → action-sheet-DgwzC3iY.js} +1 -1
  3. package/dist/action-sheet.js +1 -1
  4. package/dist/{chart-BNzfIfQe.js → chart-Gb_P3Kdq.js} +344 -333
  5. package/dist/chart.js +1 -1
  6. package/dist/{column-manager-CNZ7Xk5_.js → column-manager-B7_a_jDK.js} +1 -1
  7. package/dist/column-manager.js +1 -1
  8. package/dist/{combobox-C46GRqAA.js → combobox-C66dNlMR.js} +176 -172
  9. package/dist/combobox.js +1 -1
  10. package/dist/dashboard-grid-CKdyO4j6.js +1043 -0
  11. package/dist/dashboard-grid.js +1 -1
  12. package/dist/{data-grid-BUgOJuGp.js → data-grid-rWMDNl-6.js} +2 -2
  13. package/dist/data-grid.js +1 -1
  14. package/dist/docs/AGENTS.snippet.md +10 -0
  15. package/dist/docs/event-calendar.json +7 -0
  16. package/dist/docs/event-calendar.md +1 -0
  17. package/dist/docs/guidelines/README.md +27 -0
  18. package/dist/docs/guidelines/async-feedback.md +108 -0
  19. package/dist/docs/guidelines/browsing.md +74 -0
  20. package/dist/docs/guidelines/builders.md +97 -0
  21. package/dist/docs/guidelines/composition.md +129 -0
  22. package/dist/docs/guidelines/conversations.md +59 -0
  23. package/dist/docs/guidelines/errors-and-conflicts.md +71 -0
  24. package/dist/docs/guidelines/forms.md +192 -0
  25. package/dist/docs/guidelines/index.md +121 -0
  26. package/dist/docs/guidelines/layout-alignment.md +95 -0
  27. package/dist/docs/guidelines/ledgers.md +45 -0
  28. package/dist/docs/guidelines/list-pages.md +165 -0
  29. package/dist/docs/guidelines/overviews.md +66 -0
  30. package/dist/docs/guidelines/own-elements.md +115 -0
  31. package/dist/docs/guidelines/reading-permissions.md +55 -0
  32. package/dist/docs/guidelines/record-pages.md +178 -0
  33. package/dist/docs/guidelines/reports.md +123 -0
  34. package/dist/docs/guidelines/shell-composition.md +94 -0
  35. package/dist/docs/guidelines/workspaces.md +46 -0
  36. package/dist/docs/index.md +12 -0
  37. package/dist/docs/progress-indicator.json +1 -2
  38. package/dist/docs/progress-indicator.md +2 -2
  39. package/dist/docs/skills/build-own-element/SKILL.md +90 -0
  40. package/dist/docs/skills/compose-screen/SKILL.md +76 -0
  41. package/dist/docs/skills/index.md +9 -0
  42. package/dist/docs/skills/review-screen/SKILL.md +70 -0
  43. package/dist/docs/skills/theme-app/SKILL.md +74 -0
  44. package/dist/docs/skills/waiting-states/SKILL.md +139 -0
  45. package/dist/docs/stat-card.json +1 -0
  46. package/dist/docs/stat-card.md +1 -1
  47. package/dist/docs/tabs.json +1 -4
  48. package/dist/docs/tabs.md +1 -1
  49. package/dist/docs/tokens.md +424 -0
  50. package/dist/{drawer-Ci3wuCVa.js → drawer-Dtospdqk.js} +1 -1
  51. package/dist/drawer.js +1 -1
  52. package/dist/{entity-picker-UGhbVwkC.js → entity-picker-Dm-y0RNE.js} +1 -1
  53. package/dist/entity-picker.js +1 -1
  54. package/dist/{event-calendar-BFdeGfC-.js → event-calendar-DYjVwTI6.js} +387 -386
  55. package/dist/event-calendar.js +1 -1
  56. package/dist/{filter-bar-b2Q9BZHf.js → filter-bar-Bh7cbqDE.js} +3 -3
  57. package/dist/filter-bar.js +1 -1
  58. package/dist/{import-export-center-D8xbCLWs.js → import-export-center-CkZ_Ar9w.js} +1 -1
  59. package/dist/import-export-center.js +1 -1
  60. package/dist/index.js +14 -14
  61. package/dist/{multi-select-CfzsvAeI.js → multi-select-B-tuIwAu.js} +226 -231
  62. package/dist/multi-select.js +1 -1
  63. package/dist/{select-UTwKjheK.js → select-hRFp8nCj.js} +128 -141
  64. package/dist/select.js +1 -1
  65. package/dist/styles.css +1 -1
  66. package/dist/{table-CzBIw9ng.js → table-Bd79IwDC.js} +1 -1
  67. package/dist/table.js +1 -1
  68. package/dist/types/chart/chart.d.ts.map +1 -1
  69. package/dist/types/combobox/combobox-collection.d.ts +1 -0
  70. package/dist/types/combobox/combobox-collection.d.ts.map +1 -1
  71. package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
  72. package/dist/types/combobox/combobox.d.ts.map +1 -1
  73. package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
  74. package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
  75. package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
  76. package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
  77. package/dist/types/event-calendar/event-calendar.d.ts +1 -1
  78. package/dist/types/event-calendar/event-calendar.d.ts.map +1 -1
  79. package/dist/types/event-calendar/event-calendar.types.d.ts +6 -0
  80. package/dist/types/event-calendar/event-calendar.types.d.ts.map +1 -1
  81. package/dist/types/menu/menu.types.d.ts +3 -1
  82. package/dist/types/menu/menu.types.d.ts.map +1 -1
  83. package/dist/types/multi-select/multi-select-collection.d.ts +0 -2
  84. package/dist/types/multi-select/multi-select-collection.d.ts.map +1 -1
  85. package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
  86. package/dist/types/multi-select/multi-select.d.ts.map +1 -1
  87. package/dist/types/select/select-collection.d.ts +0 -2
  88. package/dist/types/select/select-collection.d.ts.map +1 -1
  89. package/dist/types/select/select.d.ts.map +1 -1
  90. package/package.json +6 -6
  91. package/dist/dashboard-grid-nfhEewA4.js +0 -1005
@@ -18,49 +18,10 @@ import { createPositioner as k } from "@slotted/core/positioner";
18
18
  import { multiSelectMessages as A } from "@slotted/core/i18n";
19
19
  import { createWidthGate as j } from "@slotted/core/measure";
20
20
  import { getLiveAnnouncer as M } from "@slotted/core/live-announcer";
21
- import { createFilter as ee, moveIndex as N } from "@slotted/core/collection";
22
- import { matchRanges as P } from "@slotted/core/highlight";
23
- //#region src/multi-select/multi-select-collection.ts
24
- var F = "[data-part='item']";
25
- function I(e) {
26
- return e === null ? [] : [...e.querySelectorAll(F)];
27
- }
28
- var L = (e) => e.dataset.value ?? "", R = (e) => e.dataset.disabled === void 0 && e.getAttribute("aria-disabled") !== "true";
29
- function z(e, t) {
30
- return e !== null && e.querySelector(`[data-part='item'][data-value="${CSS.escape(t)}"]`)?.hasAttribute("data-create") === !0;
31
- }
32
- function B(e, t, n, r) {
33
- let i = I(e);
34
- if (i.length === 0) return null;
35
- let a = N({
36
- enabled: i.map(R),
37
- from: t === null ? -1 : i.findIndex((e) => L(e) === t),
38
- intent: n,
39
- loop: r
40
- });
41
- return a === -1 ? null : L(i[a]);
42
- }
43
- function te(e, t, n) {
44
- return t === "none" ? null : B(e, null, t, n);
45
- }
46
- function V(e, t) {
47
- if (e === null || t === null) return;
48
- let n = I(e).find((e) => L(e) === t);
49
- n !== void 0 && ne(n, e);
50
- }
51
- function ne(e, t) {
52
- let n = t;
53
- for (let r = e.parentElement; r !== null && r !== t; r = r.parentElement) {
54
- let e = getComputedStyle(r).overflowY;
55
- if (e === "auto" || e === "scroll") {
56
- n = r;
57
- break;
58
- }
59
- }
60
- let r = e.getBoundingClientRect(), i = n.getBoundingClientRect().top + n.clientTop, a = i + n.clientHeight;
61
- r.top < i ? n.scrollTop -= i - r.top : r.bottom > a && (n.scrollTop += Math.min(r.bottom - a, r.top - i));
62
- }
63
- var H = "[data-part='chips'] > [role='gridcell']:not([data-part='field'])", U = {
21
+ import { createFilter as ee, moveIndex as N, revealWithin as P } from "@slotted/core/collection";
22
+ import { matchRanges as F } from "@slotted/core/highlight";
23
+ //#region src/multi-select/multi-select-defaults.tsx
24
+ var I = {
64
25
  addOnPaste: !0,
65
26
  align: "start",
66
27
  alignOffset: 0,
@@ -98,12 +59,12 @@ var H = "[data-part='chips'] > [role='gridcell']:not([data-part='field'])", U =
98
59
  strategy: "absolute",
99
60
  variant: "outline",
100
61
  width: "content"
101
- }, W = u(U);
102
- function G() {
103
- return f(W);
62
+ }, L = u(I);
63
+ function R() {
64
+ return f(L);
104
65
  }
105
- function re({ children: e, container: t, ...n }) {
106
- let r = G();
66
+ function z({ children: e, container: t, ...n }) {
67
+ let r = R();
107
68
  p(() => {
108
69
  if (t !== void 0) return E(t), () => E(null);
109
70
  }, [t]);
@@ -146,84 +107,84 @@ function re({ children: e, container: t, ...n }) {
146
107
  variant: n.variant ?? r.variant,
147
108
  width: n.width ?? r.width
148
109
  };
149
- return /* @__PURE__ */ x(W.Provider, {
110
+ return /* @__PURE__ */ x(L.Provider, {
150
111
  value: i,
151
112
  children: e
152
113
  });
153
114
  }
154
115
  //#endregion
155
116
  //#region src/multi-select/multi-select.tsx
156
- var ie = u(void 0);
157
- function K() {
158
- let e = f(ie);
117
+ var B = u(void 0);
118
+ function V() {
119
+ let e = f(B);
159
120
  if (e === void 0) throw Error("MultiSelectControl, MultiSelectContent and every option have to be inside a MultiSelect.");
160
121
  return e;
161
122
  }
162
- var ae = (e) => "options" in e;
163
- function oe(e) {
164
- return e === void 0 ? [] : e.flatMap((e) => ae(e) ? e.options : [e]);
123
+ var H = (e) => "options" in e;
124
+ function U(e) {
125
+ return e === void 0 ? [] : e.flatMap((e) => H(e) ? e.options : [e]);
165
126
  }
166
- var se = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]);
167
- function ce({ children: e, defaultHighlightedValue: t = null, defaultInputValue: n = "", defaultOpen: o = !1, defaultValue: s = [], filter: c, form: u, highlightedValue: f, inputValue: p, items: g, locale: b, messages: S, name: C, onHighlightedValueChange: w, onInputValueChange: T, onLoadMore: E, onOpenChange: D, onValueChange: O, onValueRefuse: k, open: j, ref: N, total: P, validateValue: F, value: I, ...L }) {
168
- let R = G(), z = a(), B = i(A, S), te = r(), V = b ?? te, H = m(), U = `${H}listbox`, W = `${H}input`, [re, K] = y(o), [ae, ce] = y(s), [le] = y(s), [ue, de] = y(n), [fe, pe] = y(t), [q, me] = y(null), [J, he] = y(null), [ge, _e] = y(null), [ve, ye] = y(!1), be = L.disabled ?? z?.disabled ?? R.disabled, xe = L.readOnly ?? z?.readOnly ?? R.readOnly, Y = L.max ?? R.max, Se = L.allowDuplicates ?? R.allowDuplicates, X = (j ?? re) && !be, Ce = I ?? ae, we = p ?? ue, Te = f === void 0 ? fe : f, Ee = v(X);
169
- X && (Ee.current = !0);
170
- let De = v("none"), Oe = v(/* @__PURE__ */ new Map()), [ke, Ae] = y(0), je = _(() => {
127
+ var te = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]);
128
+ function W({ children: e, defaultHighlightedValue: t = null, defaultInputValue: n = "", defaultOpen: o = !1, defaultValue: s = [], filter: c, form: u, highlightedValue: f, inputValue: p, items: g, locale: b, messages: S, name: C, onHighlightedValueChange: w, onInputValueChange: T, onLoadMore: E, onOpenChange: D, onValueChange: O, onValueRefuse: k, open: j, ref: N, total: F, validateValue: I, value: L, ...z }) {
129
+ let V = R(), H = a(), W = i(A, S), ne = r(), G = b ?? ne, K = m(), q = `${K}listbox`, re = `${K}input`, [ie, ae] = y(o), [oe, se] = y(s), [J] = y(s), [ce, le] = y(n), [ue, de] = y(t), [Y, fe] = y(null), [X, pe] = y(null), [me, he] = y(null), [ge, _e] = y(!1), ve = z.disabled ?? H?.disabled ?? V.disabled, ye = z.readOnly ?? H?.readOnly ?? V.readOnly, Z = z.max ?? V.max, be = z.allowDuplicates ?? V.allowDuplicates, xe = (j ?? ie) && !ve, Se = L ?? oe, Ce = p ?? ce, we = f === void 0 ? ue : f, Te = v(xe);
130
+ xe && (Te.current = !0);
131
+ let Ee = v("none"), De = v(/* @__PURE__ */ new Map()), [Oe, ke] = y(0), Ae = _(() => {
171
132
  let e = /* @__PURE__ */ new Map();
172
- for (let t of oe(g)) e.set(t.value, t.label);
133
+ for (let t of U(g)) e.set(t.value, t.label);
173
134
  return e;
174
- }, [g]), Me = d((e, t) => {
175
- Oe.current.get(e) !== t && (Oe.current.set(e, t), Ae((e) => e + 1));
176
- }, []), Ne = d((e) => je.get(e) ?? Oe.current.get(e), [je, ke]), Pe = d((e) => `${H}option-${encodeURIComponent(e)}`, [H]), Z = we, Fe = _(() => ee({ locale: V }), [V]), Ie = d((e) => Z === "" || c === null ? !0 : c === void 0 ? Fe.contains(e, Z) : c(e, Z), [
135
+ }, [g]), je = d((e, t) => {
136
+ De.current.get(e) !== t && (De.current.set(e, t), ke((e) => e + 1));
137
+ }, []), Me = d((e) => Ae.get(e) ?? De.current.get(e), [Ae, Oe]), Ne = d((e) => `${K}option-${encodeURIComponent(e)}`, [K]), Pe = Ce, Fe = _(() => ee({ locale: G }), [G]), Ie = d((e) => Pe === "" || c === null ? !0 : c === void 0 ? Fe.contains(e, Pe) : c(e, Pe), [
177
138
  Fe,
178
139
  c,
179
- Z
140
+ Pe
180
141
  ]), Le = d((e) => {
181
- e !== "" && M(q?.ownerDocument).announce(e, { repeat: !0 });
182
- }, [q]), Q = v({
183
- allowDuplicates: Se,
142
+ e !== "" && M(Y?.ownerDocument).announce(e, { repeat: !0 });
143
+ }, [Y]), Q = v({
144
+ allowDuplicates: be,
184
145
  announcer: Le,
185
146
  collator: Fe,
186
- currentHighlighted: Te,
187
- currentInput: we,
188
- currentOpen: X,
189
- currentValue: Ce,
147
+ currentHighlighted: we,
148
+ currentInput: Ce,
149
+ currentOpen: xe,
150
+ currentValue: Se,
190
151
  highlightedValue: f,
191
- inputNode: q,
152
+ inputNode: Y,
192
153
  inputValue: p,
193
- labelFor: Ne,
194
- max: Y,
154
+ labelFor: Me,
155
+ max: Z,
195
156
  onHighlightedValueChange: w,
196
157
  onInputValueChange: T,
197
158
  onOpenChange: D,
198
159
  onValueChange: O,
199
160
  onValueRefuse: k,
200
161
  open: j,
201
- t: B,
202
- validateValue: F,
203
- value: I
162
+ t: W,
163
+ validateValue: I,
164
+ value: L
204
165
  });
205
166
  Q.current = {
206
- allowDuplicates: Se,
167
+ allowDuplicates: be,
207
168
  announcer: Le,
208
169
  collator: Fe,
209
- currentHighlighted: Te,
210
- currentInput: we,
211
- currentOpen: X,
212
- currentValue: Ce,
170
+ currentHighlighted: we,
171
+ currentInput: Ce,
172
+ currentOpen: xe,
173
+ currentValue: Se,
213
174
  highlightedValue: f,
214
- inputNode: q,
175
+ inputNode: Y,
215
176
  inputValue: p,
216
- labelFor: Ne,
217
- max: Y,
177
+ labelFor: Me,
178
+ max: Z,
218
179
  onHighlightedValueChange: w,
219
180
  onInputValueChange: T,
220
181
  onOpenChange: D,
221
182
  onValueChange: O,
222
183
  onValueRefuse: k,
223
184
  open: j,
224
- t: B,
225
- validateValue: F,
226
- value: I
185
+ t: W,
186
+ validateValue: I,
187
+ value: L
227
188
  };
228
189
  let Re = d((e, t, n) => {
229
190
  let r = Q.current;
@@ -231,28 +192,28 @@ function ce({ children: e, defaultHighlightedValue: t = null, defaultInputValue:
231
192
  controlled: r.open,
232
193
  initial: r.currentOpen,
233
194
  onRequest: (e) => r.onOpenChange?.(e.value, e)
234
- }).request(e, t, n) && (K(e), e || (pe(null), De.current = "none"));
195
+ }).request(e, t, n) && (ae(e), e || (de(null), Ee.current = "none"));
235
196
  }, []), ze = d((e, t, n) => {
236
197
  let r = Q.current;
237
198
  e !== r.currentHighlighted && l({
238
199
  controlled: r.highlightedValue,
239
200
  initial: r.currentHighlighted,
240
201
  onRequest: (e) => r.onHighlightedValueChange?.(e.value, e)
241
- }).request(e, t, n) && pe(e);
202
+ }).request(e, t, n) && de(e);
242
203
  }, []), Be = d((e, t, n) => {
243
204
  let r = Q.current;
244
205
  e !== r.currentInput && l({
245
206
  controlled: r.inputValue,
246
207
  initial: r.currentInput,
247
208
  onRequest: (e) => r.onInputValueChange?.(e.value, e)
248
- }).request(e, t, n) && de(e);
209
+ }).request(e, t, n) && le(e);
249
210
  }, []), $ = d((e, t, n) => {
250
211
  let r = Q.current;
251
- return se(e, r.currentValue) || !l({
212
+ return te(e, r.currentValue) || !l({
252
213
  controlled: r.value,
253
214
  initial: r.currentValue,
254
215
  onRequest: (e) => r.onValueChange?.(e.value, e)
255
- }).request(e, t, n) ? !1 : (ce(e), !0);
216
+ }).request(e, t, n) ? !1 : (se(e), !0);
256
217
  }, []), Ve = d((e, t) => {
257
218
  let n = Q.current, r = [...t], i = {
258
219
  duplicate: [],
@@ -295,7 +256,7 @@ function ce({ children: e, defaultHighlightedValue: t = null, defaultInputValue:
295
256
  cause: t,
296
257
  source: n
297
258
  });
298
- t !== null && _e(t), e.limit.length > 0 && r.max !== null && r.announcer(r.t("counter", {
259
+ t !== null && he(t), e.limit.length > 0 && r.max !== null && r.announcer(r.t("counter", {
299
260
  count: r.max,
300
261
  max: r.max
301
262
  }));
@@ -331,10 +292,10 @@ function ce({ children: e, defaultHighlightedValue: t = null, defaultInputValue:
331
292
  }, [Ue, Ge]), qe = d((e) => {
332
293
  $([], "clear", e), Be("", "clear", e);
333
294
  }, [$, Be]), Je = d((e) => {
334
- $(le, "programmatic", e), Be("", "programmatic", e);
295
+ $(J, "programmatic", e), Be("", "programmatic", e);
335
296
  }, [
336
297
  $,
337
- le,
298
+ J,
338
299
  Be
339
300
  ]), Ye = d((e, t, n) => {
340
301
  let r = Q.current, i = r.currentValue;
@@ -349,105 +310,134 @@ function ce({ children: e, defaultHighlightedValue: t = null, defaultInputValue:
349
310
  focus: () => Q.current.inputNode?.focus({ preventScroll: !0 }),
350
311
  open: () => Re(!0, "programmatic"),
351
312
  scrollToKey: (e) => {
352
- let t = J?.querySelector(`[data-part='item'][data-value="${CSS.escape(e)}"]`);
353
- t != null && J !== null && ne(t, J);
313
+ let t = X?.querySelector(`[data-part='item'][data-value="${CSS.escape(e)}"]`);
314
+ t != null && X !== null && P(t, X);
354
315
  },
355
316
  setValue: (e, t = "programmatic") => $([...e], t)
356
317
  }), [
357
318
  $,
358
- J,
319
+ X,
359
320
  Re
360
321
  ]);
361
322
  let Xe = {
362
- addOnPaste: L.addOnPaste ?? R.addOnPaste,
323
+ addOnPaste: z.addOnPaste ?? V.addOnPaste,
363
324
  admit: Ue,
364
- align: L.align ?? R.align,
365
- alignOffset: L.alignOffset ?? R.alignOffset,
325
+ align: z.align ?? V.align,
326
+ alignOffset: z.alignOffset ?? V.alignOffset,
366
327
  announce: Le,
367
- chosenOptions: L.chosenOptions ?? R.chosenOptions,
328
+ chosenOptions: z.chosenOptions ?? V.chosenOptions,
368
329
  clear: qe,
369
- clearable: L.clearable ?? R.clearable,
370
- closeOnEscape: L.closeOnEscape ?? R.closeOnEscape,
371
- closeOnOutsidePress: L.closeOnOutsidePress ?? R.closeOnOutsidePress,
372
- closeOnSelect: L.closeOnSelect ?? R.closeOnSelect,
373
- collisionPadding: L.collisionPadding ?? R.collisionPadding,
374
- commitOnBlur: L.commitOnBlur ?? R.commitOnBlur,
375
- contentId: U,
376
- contentNode: J,
377
- creatable: L.creatable ?? R.creatable,
378
- delimiters: L.delimiters ?? R.delimiters,
379
- disabled: be,
380
- duplicate: ge,
381
- editable: L.editable ?? R.editable,
382
- entry: De,
383
- flip: L.flip ?? R.flip,
330
+ clearable: z.clearable ?? V.clearable,
331
+ closeOnEscape: z.closeOnEscape ?? V.closeOnEscape,
332
+ closeOnOutsidePress: z.closeOnOutsidePress ?? V.closeOnOutsidePress,
333
+ closeOnSelect: z.closeOnSelect ?? V.closeOnSelect,
334
+ collisionPadding: z.collisionPadding ?? V.collisionPadding,
335
+ commitOnBlur: z.commitOnBlur ?? V.commitOnBlur,
336
+ contentId: q,
337
+ contentNode: X,
338
+ creatable: z.creatable ?? V.creatable,
339
+ delimiters: z.delimiters ?? V.delimiters,
340
+ disabled: ve,
341
+ duplicate: me,
342
+ editable: z.editable ?? V.editable,
343
+ entry: Ee,
344
+ flip: z.flip ?? V.flip,
384
345
  form: u,
385
- full: Y !== null && Ce.length >= Y,
386
- fullWidth: L.fullWidth ?? R.fullWidth,
387
- hideWhenDetached: L.hideWhenDetached ?? R.hideWhenDetached,
388
- highlighted: Te,
389
- highlightMatch: L.highlightMatch ?? R.highlightMatch,
390
- inputId: W,
391
- inputNode: q,
392
- inputValue: we,
393
- invalid: L.invalid ?? z?.invalid ?? R.invalid,
394
- labelFor: Ne,
395
- loading: L.loading ?? R.loading,
396
- locale: V,
397
- loop: L.loop ?? R.loop,
346
+ full: Z !== null && Se.length >= Z,
347
+ fullWidth: z.fullWidth ?? V.fullWidth,
348
+ hideWhenDetached: z.hideWhenDetached ?? V.hideWhenDetached,
349
+ highlighted: we,
350
+ highlightMatch: z.highlightMatch ?? V.highlightMatch,
351
+ inputId: re,
352
+ inputNode: Y,
353
+ inputValue: Ce,
354
+ invalid: z.invalid ?? H?.invalid ?? V.invalid,
355
+ labelFor: Me,
356
+ loading: z.loading ?? V.loading,
357
+ locale: G,
358
+ loop: z.loop ?? V.loop,
398
359
  matches: Ie,
399
- max: Y,
400
- mount: L.mount ?? R.mount,
360
+ max: Z,
361
+ mount: z.mount ?? V.mount,
401
362
  move: Ye,
402
363
  name: C,
403
- narrow: ve,
364
+ narrow: ge,
404
365
  onLoadMore: E,
405
- open: X,
406
- openOn: L.openOn ?? R.openOn,
407
- optionId: Pe,
408
- overflow: L.overflow ?? R.overflow,
409
- portal: L.portal ?? R.portal,
410
- query: Z,
411
- readOnly: xe,
412
- registerLabel: Me,
366
+ open: xe,
367
+ openOn: z.openOn ?? V.openOn,
368
+ optionId: Ne,
369
+ overflow: z.overflow ?? V.overflow,
370
+ portal: z.portal ?? V.portal,
371
+ query: Pe,
372
+ readOnly: ye,
373
+ registerLabel: je,
413
374
  remove: Ge,
414
375
  replace: We,
415
376
  restore: Je,
416
- reorderable: L.reorderable ?? R.reorderable,
417
- required: L.required ?? z?.required ?? R.required,
418
- seen: Ee.current,
419
- setContentNode: he,
420
- setDuplicate: _e,
377
+ reorderable: z.reorderable ?? V.reorderable,
378
+ required: z.required ?? H?.required ?? V.required,
379
+ seen: Te.current,
380
+ setContentNode: pe,
381
+ setDuplicate: he,
421
382
  setHighlighted: ze,
422
- setInputNode: me,
383
+ setInputNode: fe,
423
384
  setInputValue: Be,
424
- setNarrow: ye,
385
+ setNarrow: _e,
425
386
  setOpen: Re,
426
- shift: L.shift ?? R.shift,
427
- side: L.side ?? R.side,
428
- sideOffset: L.sideOffset ?? R.sideOffset,
429
- size: L.size ?? z?.size ?? R.size,
430
- strategy: L.strategy ?? R.strategy,
387
+ shift: z.shift ?? V.shift,
388
+ side: z.side ?? V.side,
389
+ sideOffset: z.sideOffset ?? V.sideOffset,
390
+ size: z.size ?? H?.size ?? V.size,
391
+ strategy: z.strategy ?? V.strategy,
431
392
  toggle: Ke,
432
- t: B,
433
- total: P,
434
- value: Ce,
435
- variant: L.variant ?? R.variant,
436
- width: L.width ?? R.width
393
+ t: W,
394
+ total: F,
395
+ value: Se,
396
+ variant: z.variant ?? V.variant,
397
+ width: z.width ?? V.width
437
398
  };
438
- return /* @__PURE__ */ x(ie.Provider, {
399
+ return /* @__PURE__ */ x(B.Provider, {
439
400
  value: Xe,
440
401
  children: e
441
402
  });
442
403
  }
443
404
  //#endregion
405
+ //#region src/multi-select/multi-select-collection.ts
406
+ var ne = e(), G = "[data-part='item']";
407
+ function K(e) {
408
+ return e === null ? [] : [...e.querySelectorAll(G)];
409
+ }
410
+ var q = (e) => e.dataset.value ?? "", re = (e) => e.dataset.disabled === void 0 && e.getAttribute("aria-disabled") !== "true";
411
+ function ie(e, t) {
412
+ return e !== null && e.querySelector(`[data-part='item'][data-value="${CSS.escape(t)}"]`)?.hasAttribute("data-create") === !0;
413
+ }
414
+ function ae(e, t, n, r) {
415
+ let i = K(e);
416
+ if (i.length === 0) return null;
417
+ let a = N({
418
+ enabled: i.map(re),
419
+ from: t === null ? -1 : i.findIndex((e) => q(e) === t),
420
+ intent: n,
421
+ loop: r
422
+ });
423
+ return a === -1 ? null : q(i[a]);
424
+ }
425
+ function oe(e, t, n) {
426
+ return t === "none" ? null : ae(e, null, t, n);
427
+ }
428
+ function se(e, t) {
429
+ if (e === null || t === null) return;
430
+ let n = K(e).find((e) => q(e) === t);
431
+ n !== void 0 && P(n, e);
432
+ }
433
+ var J = "[data-part='chips'] > [role='gridcell']:not([data-part='field'])";
434
+ //#endregion
444
435
  //#region src/multi-select/multi-select-chips.tsx
445
- var le = e();
446
- function ue(e, t) {
436
+ function ce(e, t) {
447
437
  return e || t;
448
438
  }
449
- function de({ count: e, index: r, label: i, value: a }) {
450
- let o = K(), [s, c] = y(null), l = v(null), u = ue(o.readOnly, o.disabled);
439
+ function le({ count: e, index: r, label: i, value: a }) {
440
+ let o = V(), [s, c] = y(null), l = v(null), u = ce(o.readOnly, o.disabled);
451
441
  p(() => {
452
442
  o.duplicate === a && (l.current?.focus({ preventScroll: !0 }), o.setDuplicate(null));
453
443
  }, [o, a]);
@@ -548,13 +538,13 @@ function de({ count: e, index: r, label: i, value: a }) {
548
538
  })
549
539
  });
550
540
  }
551
- function fe({ children: e }) {
552
- let t = K(), n = v(null), r = v(null), i = v(null), [a, o] = y(0), l = t.overflow === "collapse";
541
+ function ue({ children: e }) {
542
+ let t = V(), n = v(null), r = v(null), i = v(null), [a, o] = y(0), l = t.overflow === "collapse";
553
543
  return p(() => {
554
544
  let e = n.current;
555
545
  if (e === null) return;
556
546
  let t = s(e, {
557
- itemSelector: `${H}, [data-part='field'] > [data-part='input']`,
547
+ itemSelector: `${J}, [data-part='field'] > [data-part='input']`,
558
548
  loop: !1,
559
549
  ownedKeys: (e) => e instanceof HTMLInputElement && e.value !== "" ? [
560
550
  "ArrowLeft",
@@ -569,7 +559,7 @@ function fe({ children: e }) {
569
559
  if (e === null) return;
570
560
  let r = c(e, {
571
561
  fallback: () => t.inputNode,
572
- itemSelector: H
562
+ itemSelector: J
573
563
  });
574
564
  return () => r.destroy();
575
565
  }, [t.inputNode]), p(() => {
@@ -582,7 +572,7 @@ function fe({ children: e }) {
582
572
  collapsible: () => !0,
583
573
  onChange: (e) => o(e.length),
584
574
  trigger: () => r.current,
585
- units: () => [...e.querySelectorAll(H)].filter((e) => !e.hasAttribute("data-count"))
575
+ units: () => [...e.querySelectorAll(J)].filter((e) => !e.hasAttribute("data-count"))
586
576
  });
587
577
  return i.current = t, () => {
588
578
  t.destroy(), i.current = null, o(0);
@@ -594,7 +584,7 @@ function fe({ children: e }) {
594
584
  ref: n,
595
585
  role: "row",
596
586
  children: [
597
- t.value.map((e, n) => /* @__PURE__ */ x(de, {
587
+ t.value.map((e, n) => /* @__PURE__ */ x(le, {
598
588
  count: t.value.length,
599
589
  index: n,
600
590
  label: t.labelFor(e) ?? e,
@@ -625,17 +615,17 @@ function fe({ children: e }) {
625
615
  }
626
616
  //#endregion
627
617
  //#region src/multi-select/multi-select-parts.tsx
628
- var pe = 120;
629
- function q(e, t) {
618
+ var de = 120;
619
+ function Y(e, t) {
630
620
  return (n) => {
631
621
  e?.(n), n.defaultPrevented || t(n);
632
622
  };
633
623
  }
634
- function me(e, ...t) {
624
+ function fe(e, ...t) {
635
625
  for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
636
626
  }
637
- function J({ ref: e, render: r, ...i }) {
638
- let o = K(), s = a(), [c, l] = y(null), u = v(null);
627
+ function X({ ref: e, render: r, ...i }) {
628
+ let o = V(), s = a(), [c, l] = y(null), u = v(null);
639
629
  p(() => {
640
630
  o.setInputNode(c);
641
631
  }, [o, c]);
@@ -666,7 +656,7 @@ function J({ ref: e, render: r, ...i }) {
666
656
  o.entry.current = e === "previous" || e === "pageUp" ? "last" : "first";
667
657
  return;
668
658
  }
669
- let n = B(o.contentNode, o.highlighted, e, o.loop);
659
+ let n = ae(o.contentNode, o.highlighted, e, o.loop);
670
660
  n !== null && o.setHighlighted(n, "keyboard", t);
671
661
  }, _ = (e) => {
672
662
  let t = o.delimiters;
@@ -679,7 +669,7 @@ function J({ ref: e, render: r, ...i }) {
679
669
  return t.trim() !== "" && (o.admit(_(t), "submit", e), o.setInputValue("", "submit", e), !0);
680
670
  }, w = (e) => {
681
671
  let t = o.highlighted;
682
- return t === null ? !1 : z(o.contentNode, t) ? (C(e), !0) : (o.toggle(t, "select", e), o.setInputValue("", "select", e), o.closeOnSelect && o.setOpen(!1, "select", e), !0);
672
+ return t === null ? !1 : ie(o.contentNode, t) ? (C(e), !0) : (o.toggle(t, "select", e), o.setInputValue("", "select", e), o.closeOnSelect && o.setOpen(!1, "select", e), !0);
683
673
  }, T = (e, t) => {
684
674
  o.entry.current = e, o.setOpen(!0, "keyboard", t);
685
675
  }, E = (e) => {
@@ -753,11 +743,11 @@ function J({ ref: e, render: r, ...i }) {
753
743
  }, P = (e) => {
754
744
  o.disabled || o.readOnly || (o.entry.current = "none", o.setOpen(!o.open, "pointer", e.nativeEvent), c?.focus({ preventScroll: !0 }));
755
745
  }, F = d((t) => {
756
- l(t), me(t, e);
746
+ l(t), fe(t, e);
757
747
  }, [e]), I = [i["aria-describedby"], s?.describedBy].filter(Boolean).join(" "), L = o.clearable && (o.value.length > 0 || o.inputValue !== "") && !o.disabled && !o.readOnly, R = o.max === null ? o.narrow && o.value.length > 0 ? o.t("chosen", { count: o.value.length }) : null : o.t("counter", {
758
748
  count: o.value.length,
759
749
  max: o.max
760
- }), te = {
750
+ }), z = {
761
751
  ref: u,
762
752
  "data-overflow": o.overflow,
763
753
  "data-part": "root",
@@ -773,12 +763,17 @@ function J({ ref: e, render: r, ...i }) {
773
763
  ...o.loading ? { "data-loading": "" } : {},
774
764
  ...o.full ? { "data-complete": "" } : {},
775
765
  ...o.narrow ? { "data-narrow": "" } : {}
776
- }, V = /* @__PURE__ */ S(b, { children: [
766
+ }, B = o.t("chosen", { count: o.value.length }), H = `${i.id ?? s?.ids.control ?? o.inputId}-chosen`, U = i["aria-labelledby"] ?? s?.ids.label, te = i["aria-label"] === void 0 ? U === void 0 ? { "aria-label": B } : { "aria-labelledby": `${U} ${H}` } : { "aria-label": `${i["aria-label"]}, ${B}` }, W = /* @__PURE__ */ S(b, { children: [
767
+ /* @__PURE__ */ x("span", {
768
+ hidden: !0,
769
+ id: H,
770
+ children: B
771
+ }),
777
772
  /* @__PURE__ */ x("div", {
778
- "aria-label": o.t("chosen", { count: o.value.length }),
773
+ ...te,
779
774
  "data-part": "control",
780
775
  role: "grid",
781
- children: /* @__PURE__ */ x(fe, { children: /* @__PURE__ */ x("span", {
776
+ children: /* @__PURE__ */ x(ue, { children: /* @__PURE__ */ x("span", {
782
777
  "data-part": "field",
783
778
  role: "gridcell",
784
779
  children: /* @__PURE__ */ x("input", {
@@ -793,12 +788,12 @@ function J({ ref: e, render: r, ...i }) {
793
788
  "data-part": "input",
794
789
  disabled: o.disabled,
795
790
  id: i.id ?? s?.ids.control ?? o.inputId,
796
- onBlur: q(i.onBlur, ee),
797
- onChange: q(i.onChange, D),
798
- onClick: q(i.onClick, A),
799
- onFocus: q(i.onFocus, k),
800
- onKeyDown: q(i.onKeyDown, E),
801
- onPaste: q(i.onPaste, M),
791
+ onBlur: Y(i.onBlur, ee),
792
+ onChange: Y(i.onChange, D),
793
+ onClick: Y(i.onClick, A),
794
+ onFocus: Y(i.onFocus, k),
795
+ onKeyDown: Y(i.onKeyDown, E),
796
+ onPaste: Y(i.onPaste, M),
802
797
  placeholder: o.value.length === 0 ? i.placeholder : void 0,
803
798
  readOnly: o.readOnly,
804
799
  ref: F,
@@ -859,15 +854,15 @@ function J({ ref: e, render: r, ...i }) {
859
854
  }, e))
860
855
  ] });
861
856
  return r === void 0 ? /* @__PURE__ */ x("div", {
862
- ...te,
863
- children: V
857
+ ...z,
858
+ children: W
864
859
  }) : r({
865
- ...te,
866
- children: V
860
+ ...z,
861
+ children: W
867
862
  });
868
863
  }
869
- function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status: s, ...c }) {
870
- let l = K(), [u, d] = y(null), [f, m] = y(null), [h, _] = y(null), [b, C] = y("unmounted"), [E, O] = y(!1), [A, j] = y(0), M = v(null), ee = v(null), N = v(l);
864
+ function pe({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status: s, ...c }) {
865
+ let l = V(), [u, d] = y(null), [f, m] = y(null), [h, _] = y(null), [b, C] = y("unmounted"), [E, O] = y(!1), [A, j] = y(0), M = v(null), ee = v(null), N = v(l);
871
866
  N.current = l, p(() => {
872
867
  let e = w({
873
868
  present: N.current.open,
@@ -893,20 +888,20 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
893
888
  l.portal,
894
889
  P
895
890
  ]);
896
- let { align: F, alignOffset: R, collisionPadding: z, flip: B, hideWhenDetached: ne, shift: H, side: U, sideOffset: W, strategy: G, width: re } = l;
891
+ let { align: F, alignOffset: I, collisionPadding: L, flip: R, hideWhenDetached: z, shift: B, side: H, sideOffset: U, strategy: te, width: W } = l;
897
892
  if (p(() => {
898
893
  if (u === null || l.inputNode === null) return;
899
894
  let e = !0, t = l.inputNode.closest("[data-part='root']") ?? l.inputNode, n = k(t, u, {
900
895
  align: F,
901
- alignOffset: R,
902
- boundaryPadding: z,
903
- flip: B,
904
- hideWhenDetached: ne,
905
- matchWidth: re === "anchor",
906
- shift: H,
907
- side: U,
908
- sideOffset: W,
909
- strategy: G
896
+ alignOffset: I,
897
+ boundaryPadding: L,
898
+ flip: R,
899
+ hideWhenDetached: z,
900
+ matchWidth: W === "anchor",
901
+ shift: B,
902
+ side: H,
903
+ sideOffset: U,
904
+ strategy: te
910
905
  });
911
906
  return n.update().then(() => {
912
907
  e && O(!0);
@@ -915,17 +910,17 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
915
910
  };
916
911
  }, [
917
912
  F,
913
+ I,
914
+ L,
918
915
  R,
919
916
  z,
920
- B,
921
- ne,
922
917
  u,
923
918
  l.inputNode,
919
+ B,
924
920
  H,
925
921
  U,
926
- W,
927
- G,
928
- re
922
+ te,
923
+ W
929
924
  ]), p(() => {
930
925
  if (u === null || !l.open) return;
931
926
  let e = [l.inputNode?.closest("[data-part='root']") ?? null].filter((e) => e !== null), t = D(u, {
@@ -947,24 +942,24 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
947
942
  l.open,
948
943
  u
949
944
  ]), g(() => {
950
- let e = I(f).filter((e) => e.dataset.create === void 0).length;
945
+ let e = K(f).filter((e) => e.dataset.create === void 0).length;
951
946
  j((t) => t === e ? t : e);
952
947
  }), g(() => {
953
948
  let e = N.current;
954
949
  if (e.open && f !== null) {
955
950
  if (e.entry.current !== "none") {
956
- let t = te(f, e.entry.current, e.loop);
951
+ let t = oe(f, e.entry.current, e.loop);
957
952
  e.entry.current = "none", t !== null && e.setHighlighted(t, "keyboard");
958
953
  return;
959
954
  }
960
- e.highlighted !== null && (I(f).some((t) => L(t) === e.highlighted) || e.setHighlighted(null, "keyboard"));
955
+ e.highlighted !== null && (K(f).some((t) => q(t) === e.highlighted) || e.setHighlighted(null, "keyboard"));
961
956
  }
962
957
  }, [
963
958
  l.open,
964
959
  A,
965
960
  f
966
961
  ]), p(() => {
967
- V(f, l.highlighted);
962
+ se(f, l.highlighted);
968
963
  }, [
969
964
  l.highlighted,
970
965
  E,
@@ -981,7 +976,7 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
981
976
  A,
982
977
  f
983
978
  ]), !P) return null;
984
- let ie = {
979
+ let G = {
985
980
  "data-align": F,
986
981
  ...l.open ? {} : { inert: !0 },
987
982
  ...l.open && E ? { "data-open": "" } : {},
@@ -989,10 +984,10 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
989
984
  "data-size": l.size,
990
985
  "data-ui": "multi-select",
991
986
  "data-width": l.width
992
- }, ae = s === void 0 ? l.loading ? l.t("loading") : A === 0 ? null : l.t("count", { count: A }) : s, oe = !l.loading && A === 0 && l.creatable && !l.full && l.query.trim() !== "", se = /* @__PURE__ */ x("div", {
993
- ...ie,
987
+ }, re = s === void 0 ? l.loading ? l.t("loading") : A === 0 ? null : l.t("count", { count: A }) : s, ie = !l.loading && A === 0 && l.creatable && !l.full && l.query.trim() !== "", ae = /* @__PURE__ */ x("div", {
988
+ ...G,
994
989
  ref: (e) => {
995
- d(e), me(e, a);
990
+ d(e), fe(e, a);
996
991
  },
997
992
  children: /* @__PURE__ */ S("div", {
998
993
  ...c,
@@ -1022,7 +1017,7 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
1022
1017
  }) : null,
1023
1018
  e,
1024
1019
  /* @__PURE__ */ x("div", { ref: ee }),
1025
- oe ? /* @__PURE__ */ S("div", {
1020
+ ie ? /* @__PURE__ */ S("div", {
1026
1021
  "data-create": "",
1027
1022
  "data-part": "item",
1028
1023
  "data-value": l.query,
@@ -1049,7 +1044,7 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
1049
1044
  })
1050
1045
  ]
1051
1046
  }) : null,
1052
- !l.loading && A === 0 && !oe ? /* @__PURE__ */ x("div", {
1047
+ !l.loading && A === 0 && !ie ? /* @__PURE__ */ x("div", {
1053
1048
  "data-part": "empty",
1054
1049
  children: i ?? l.t("empty")
1055
1050
  }) : null,
@@ -1072,20 +1067,20 @@ function he({ children: e, chosen: r = !0, empty: i, ref: a, render: o, status:
1072
1067
  "data-part": "status",
1073
1068
  ...l.loading ? { "data-loading": "" } : {},
1074
1069
  role: "status",
1075
- children: ae
1070
+ children: re
1076
1071
  })
1077
1072
  ]
1078
1073
  })
1079
- }), ce = o === void 0 ? se : o({
1080
- ...ie,
1074
+ }), J = o === void 0 ? ae : o({
1075
+ ...G,
1081
1076
  children: e
1082
1077
  });
1083
- return h === null ? ce : (0, le.createPortal)(ce, h);
1078
+ return h === null ? J : (0, ne.createPortal)(J, h);
1084
1079
  }
1085
1080
  //#endregion
1086
1081
  //#region src/multi-select/multi-select-items.tsx
1087
- function ge({ children: e, description: r, disabled: i = !1, icon: a, position: s, ref: c, textValue: l, value: u, ...d }) {
1088
- let f = K(), [m, h] = y(null), g = v(null), b = l ?? (typeof e == "string" ? e : void 0);
1082
+ function me({ children: e, description: r, disabled: i = !1, icon: a, position: s, ref: c, textValue: l, value: u, ...d }) {
1083
+ let f = V(), [m, h] = y(null), g = v(null), b = l ?? (typeof e == "string" ? e : void 0);
1089
1084
  p(() => {
1090
1085
  if (m === null) return;
1091
1086
  let e = b ?? m.querySelector("[data-part='label']")?.textContent?.trim() ?? "";
@@ -1098,7 +1093,7 @@ function ge({ children: e, description: r, disabled: i = !1, icon: a, position:
1098
1093
  ]);
1099
1094
  let C = _(() => {
1100
1095
  if (!f.highlightMatch || f.query === "" || b === void 0) return e;
1101
- let t = P(b, f.query, { locale: f.locale });
1096
+ let t = F(b, f.query, { locale: f.locale });
1102
1097
  return t.length === 0 ? e : /* @__PURE__ */ x(o, {
1103
1098
  ranges: t,
1104
1099
  text: b
@@ -1160,8 +1155,8 @@ function ge({ children: e, description: r, disabled: i = !1, icon: a, position:
1160
1155
  ]
1161
1156
  });
1162
1157
  }
1163
- function _e({ children: e, label: t, ...n }) {
1164
- let r = `${m()}group`, { query: i, value: a } = K(), [o, s] = y(null), [c, l] = y(!1);
1158
+ function he({ children: e, label: t, ...n }) {
1159
+ let r = `${m()}group`, { query: i, value: a } = V(), [o, s] = y(null), [c, l] = y(!1);
1165
1160
  return p(() => {
1166
1161
  o !== null && l(o.querySelector("[data-part='item']") === null);
1167
1162
  }, [
@@ -1182,7 +1177,7 @@ function _e({ children: e, label: t, ...n }) {
1182
1177
  }), e]
1183
1178
  });
1184
1179
  }
1185
- function ve(e) {
1180
+ function ge(e) {
1186
1181
  return /* @__PURE__ */ x("div", {
1187
1182
  "data-part": "separator",
1188
1183
  ref: e.ref,
@@ -1190,4 +1185,4 @@ function ve(e) {
1190
1185
  });
1191
1186
  }
1192
1187
  //#endregion
1193
- export { J as a, K as c, G as d, he as i, U as l, ge as n, pe as o, ve as r, ce as s, _e as t, re as u };
1188
+ export { X as a, V as c, R as d, pe as i, I as l, me as n, de as o, ge as r, W as s, he as t, z as u };