@vizejs/ui 0.345.0 → 0.350.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 (96) hide show
  1. package/dist/{button-D7sM9Xmj.d.mts → button-CVX8UBXj.d.mts} +6 -7
  2. package/dist/{button-8BOlFJNu.mjs → button-DT8AKlds.mjs} +2 -2
  3. package/dist/button.d.mts +1 -1
  4. package/dist/button.mjs +1 -1
  5. package/dist/catalog.d.mts +541 -0
  6. package/dist/catalog.mjs +784 -0
  7. package/dist/{checkbox-B4y9GUen.mjs → checkbox-BgIvwjyC.mjs} +2 -2
  8. package/dist/{checkbox-DkwZFC80.d.mts → checkbox-DP3_ko7D.d.mts} +7 -8
  9. package/dist/checkbox.d.mts +1 -1
  10. package/dist/checkbox.mjs +1 -1
  11. package/dist/collection-B_dFZOHO.d.mts +185 -0
  12. package/dist/collection-eHN150dT.mjs +453 -0
  13. package/dist/collection.d.mts +2 -0
  14. package/dist/collection.mjs +2 -0
  15. package/dist/composite-navigation-QINW9GLy.d.mts +115 -0
  16. package/dist/composite-navigation-Skx3LZsv.mjs +354 -0
  17. package/dist/composite-navigation.d.mts +2 -0
  18. package/dist/composite-navigation.mjs +2 -0
  19. package/dist/controllable-state.d.mts +1 -1
  20. package/dist/dismissable-layer-4icKahVs.d.mts +119 -0
  21. package/dist/dismissable-layer-CwG1gtdz.mjs +488 -0
  22. package/dist/dismissable-layer.d.mts +2 -0
  23. package/dist/dismissable-layer.mjs +2 -0
  24. package/dist/focus-CAWi_I-0.mjs +318 -0
  25. package/dist/focus-K6dOifoZ.d.mts +112 -0
  26. package/dist/focus-guards-Bt0C-0qS.d.mts +81 -0
  27. package/dist/focus-guards-DhMPQAT8.mjs +299 -0
  28. package/dist/focus-guards.d.mts +2 -0
  29. package/dist/focus-guards.mjs +2 -0
  30. package/dist/focus-scope-CavhKWx0.d.mts +100 -0
  31. package/dist/focus-scope-D9U1aj67.mjs +340 -0
  32. package/dist/focus-scope-dom-DBwNEWxG.mjs +264 -0
  33. package/dist/focus-scope.d.mts +2 -0
  34. package/dist/focus-scope.mjs +2 -0
  35. package/dist/focus.d.mts +2 -0
  36. package/dist/focus.mjs +2 -0
  37. package/dist/hover-BXwwbSaO.d.mts +80 -0
  38. package/dist/hover.d.mts +2 -0
  39. package/dist/hover.mjs +197 -0
  40. package/dist/id-5OAUyVPd.d.mts +126 -0
  41. package/dist/id-mziSyAse.mjs +137 -0
  42. package/dist/id.d.mts +2 -0
  43. package/dist/id.mjs +2 -0
  44. package/dist/index.d.mts +23 -6
  45. package/dist/index.mjs +21 -5
  46. package/dist/inert-outside-CyqtoKQ4.mjs +346 -0
  47. package/dist/inert-outside-tuHRmaqJ.d.mts +43 -0
  48. package/dist/inert-outside.d.mts +2 -0
  49. package/dist/inert-outside.mjs +2 -0
  50. package/dist/interaction-modality-DOZK0BpZ.mjs +304 -0
  51. package/dist/interaction-modality-jgHKjPFB.d.mts +89 -0
  52. package/dist/interaction-modality.d.mts +2 -0
  53. package/dist/interaction-modality.mjs +2 -0
  54. package/dist/long-press-Dsul69gk.mjs +340 -0
  55. package/dist/long-press-cll6z2K9.d.mts +105 -0
  56. package/dist/long-press.d.mts +2 -0
  57. package/dist/long-press.mjs +2 -0
  58. package/dist/media-pdf.d.mts +1 -1
  59. package/dist/media-pdf.mjs +1 -1
  60. package/dist/media.d.mts +1 -1
  61. package/dist/media.mjs +1 -1
  62. package/dist/move-BOmXDYbh.d.mts +103 -0
  63. package/dist/move-BVvMHzxr.mjs +386 -0
  64. package/dist/move.d.mts +2 -0
  65. package/dist/move.mjs +2 -0
  66. package/dist/press-N_mE3Mgx.mjs +469 -0
  67. package/dist/press-event-Cd2OPpmw.mjs +149 -0
  68. package/dist/press-types-CNqStzJf.d.mts +112 -0
  69. package/dist/press.d.mts +14 -0
  70. package/dist/press.mjs +2 -0
  71. package/dist/{primitive-DJB7pOf3.mjs → primitive-BX31dogp.mjs} +2 -2
  72. package/dist/{primitive-BtvwikH1.d.mts → primitive-C8jW7DLd.d.mts} +3 -4
  73. package/dist/primitive.d.mts +1 -1
  74. package/dist/primitive.mjs +1 -1
  75. package/dist/scroll-lock-BgVtX4wT.d.mts +49 -0
  76. package/dist/scroll-lock-Ckbmm0-J.mjs +313 -0
  77. package/dist/scroll-lock.d.mts +2 -0
  78. package/dist/scroll-lock.mjs +2 -0
  79. package/dist/spatial-navigation-CHj9mDZH.d.mts +106 -0
  80. package/dist/spatial-navigation-D6-UDavU.mjs +301 -0
  81. package/dist/spatial-navigation.d.mts +2 -0
  82. package/dist/spatial-navigation.mjs +2 -0
  83. package/dist/typeahead-B7KDxE_u.mjs +175 -0
  84. package/dist/typeahead-BbgUB2Bj.d.mts +71 -0
  85. package/dist/typeahead.d.mts +2 -0
  86. package/dist/typeahead.mjs +2 -0
  87. package/dist/visually-hidden-BOqfqBFt.d.mts +17 -0
  88. package/dist/{visually-hidden-QENRapzW.mjs → visually-hidden-BwDOx5yf.mjs} +2 -2
  89. package/dist/visually-hidden.d.mts +1 -1
  90. package/dist/visually-hidden.mjs +1 -1
  91. package/package.json +99 -11
  92. package/dist/visually-hidden-BegtnMng.d.mts +0 -19
  93. /package/dist/{_plugin-vue_export-helper-BVN2DL-U.mjs → _plugin-vue_export-helper-BOaGB7Aw.mjs} +0 -0
  94. /package/dist/{controllable-state-DXsYJ3yl.d.mts → controllable-state-BtoxKahh.d.mts} +0 -0
  95. /package/dist/{pdf-source-COxN3A1l.d.mts → pdf-source-BYFK2Pks.d.mts} +0 -0
  96. /package/dist/{pdf-source-C52YE8tp.mjs → pdf-source-zu1LkCeE.mjs} +0 -0
@@ -0,0 +1,354 @@
1
+ import { t as createTypeahead } from "./typeahead-B7KDxE_u.mjs";
2
+ import { getCurrentScope, onScopeDispose, toValue } from "vue";
3
+ //#region src/composite-navigation-internal.ts
4
+ const optionDiagnostic = "VIZE_UI_COMPOSITE_NAVIGATION_OPTION";
5
+ function capture(errors, callback) {
6
+ try {
7
+ callback();
8
+ } catch (error) {
9
+ errors.push(error);
10
+ }
11
+ }
12
+ function surfaceErrors(errors, message) {
13
+ if (errors.length === 1) throw errors[0];
14
+ if (errors.length < 2) return;
15
+ const Aggregate = globalThis.AggregateError;
16
+ if (typeof Aggregate === "function") throw new Aggregate(errors, message);
17
+ const fallback = Object.assign(new Error(message), { errors: [...errors] });
18
+ fallback.name = "AggregateError";
19
+ throw fallback;
20
+ }
21
+ function readBoolean(source, name) {
22
+ const value = toValue(source);
23
+ if (value === void 0) return false;
24
+ if (typeof value !== "boolean") throw new TypeError(`${optionDiagnostic}: ${name} must resolve to a boolean`);
25
+ return value;
26
+ }
27
+ function readOrientation(source) {
28
+ const value = toValue(source) ?? "vertical";
29
+ if (value !== "both" && value !== "horizontal" && value !== "vertical") throw new TypeError(`${optionDiagnostic}: orientation must resolve to both, horizontal, or vertical`);
30
+ return value;
31
+ }
32
+ function readDirection(source) {
33
+ const value = toValue(source) ?? "ltr";
34
+ if (value !== "ltr" && value !== "rtl") throw new TypeError(`${optionDiagnostic}: direction must resolve to ltr or rtl`);
35
+ return value;
36
+ }
37
+ function readPageSize(source) {
38
+ const value = toValue(source) ?? 10;
39
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1) throw new TypeError(`${optionDiagnostic}: pageSize must resolve to a positive safe integer`);
40
+ return value;
41
+ }
42
+ function readStrategy(value) {
43
+ const strategy = value ?? "roving";
44
+ if (strategy !== "roving" && strategy !== "active-descendant") throw new TypeError(`${optionDiagnostic}: focusStrategy must be roving or active-descendant`);
45
+ return strategy;
46
+ }
47
+ function keyIntent(event, orientation, direction) {
48
+ if (event.isComposing || event.altKey || event.ctrlKey || event.metaKey) return null;
49
+ if (event.key === "Home") return "first";
50
+ if (event.key === "End") return "last";
51
+ if (event.key === "PageDown") return "page-next";
52
+ if (event.key === "PageUp") return "page-previous";
53
+ if ((orientation === "vertical" || orientation === "both") && event.key === "ArrowDown") return "next";
54
+ if ((orientation === "vertical" || orientation === "both") && event.key === "ArrowUp") return "previous";
55
+ if (orientation === "horizontal" || orientation === "both") {
56
+ if (event.key === "ArrowRight") return direction === "rtl" ? "previous" : "next";
57
+ if (event.key === "ArrowLeft") return direction === "rtl" ? "next" : "previous";
58
+ }
59
+ return null;
60
+ }
61
+ function validateId(value) {
62
+ if (typeof value !== "string" || value.length === 0) throw new TypeError("VIZE_UI_COMPOSITE_NAVIGATION_ID: an item ID must be non-empty and contain no ASCII whitespace or controls");
63
+ for (let index = 0; index < value.length; index++) {
64
+ const code = value.charCodeAt(index);
65
+ if (code <= 32 || code === 127) throw new TypeError("VIZE_UI_COMPOSITE_NAVIGATION_ID: an item ID must be non-empty and contain no ASCII whitespace or controls");
66
+ }
67
+ return value;
68
+ }
69
+ function validateOptions(options) {
70
+ if (!options || typeof options !== "object" || Array.isArray(options)) throw new TypeError(`${optionDiagnostic}: options must be an object`);
71
+ const registry = options.registry;
72
+ if (!registry || typeof registry.getNavigationKey !== "function" || !registry.activeKey) throw new TypeError(`${optionDiagnostic}: registry must be a CollectionRegistry`);
73
+ const strategy = readStrategy(options.focusStrategy);
74
+ if (strategy === "active-descendant" && typeof options.getItemId !== "function") throw new TypeError(`${optionDiagnostic}: active-descendant requires a getItemId function`);
75
+ for (const name of [
76
+ "getItemId",
77
+ "onNavigate",
78
+ "scrollIntoView"
79
+ ]) {
80
+ const callback = options[name];
81
+ if (callback !== void 0 && typeof callback !== "function") throw new TypeError(`${optionDiagnostic}: ${name} must be a function`);
82
+ }
83
+ readOrientation(options.orientation);
84
+ readDirection(options.direction);
85
+ readBoolean(options.loop, "loop");
86
+ readBoolean(options.isDisabled, "isDisabled");
87
+ readPageSize(options.pageSize);
88
+ if (strategy === "roving") readBoolean(options.preventScroll, "preventScroll");
89
+ if (options.typeahead !== void 0 && options.typeahead !== false && (!options.typeahead || typeof options.typeahead !== "object" || Array.isArray(options.typeahead))) throw new TypeError(`${optionDiagnostic}: typeahead must be false or an options object`);
90
+ return strategy;
91
+ }
92
+ const nonTextInputType = /^(?:button|checkbox|color|file|image|radio|range|reset|submit)$/iu;
93
+ function isEditableDescendant(event) {
94
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [event.target];
95
+ for (const candidate of path) {
96
+ if (candidate === event.currentTarget) break;
97
+ const target = candidate;
98
+ const name = target?.localName;
99
+ if (name === "input") {
100
+ if (!nonTextInputType.test(target?.type ?? "text")) return true;
101
+ continue;
102
+ }
103
+ if (name === "select" || name === "textarea" || target?.isContentEditable === true) return true;
104
+ }
105
+ return false;
106
+ }
107
+ function validateCommand(value) {
108
+ if (value !== "first" && value !== "last" && value !== "next" && value !== "page-next" && value !== "page-previous" && value !== "previous") throw new TypeError(`${optionDiagnostic}: navigation intent is invalid`);
109
+ return value;
110
+ }
111
+ //#endregion
112
+ //#region src/composite-navigation-dom.ts
113
+ function eventElement(value) {
114
+ const candidate = value;
115
+ return candidate?.nodeType === 1 && typeof candidate.getRootNode === "function" ? candidate : null;
116
+ }
117
+ function focusItem(element, preventScroll, errors) {
118
+ const focusable = element;
119
+ if (typeof focusable?.focus !== "function") {
120
+ errors.push(/* @__PURE__ */ new Error("VIZE_UI_COMPOSITE_NAVIGATION_FOCUS: active roving item is not focusable"));
121
+ return;
122
+ }
123
+ capture(errors, () => {
124
+ try {
125
+ focusable.focus?.({ preventScroll });
126
+ } catch {
127
+ focusable.focus?.();
128
+ }
129
+ });
130
+ }
131
+ function revealItem(item, custom, event, errors) {
132
+ if (custom) {
133
+ capture(errors, () => custom(item, event));
134
+ return;
135
+ }
136
+ const reveal = item.element?.scrollIntoView;
137
+ if (typeof reveal === "function") capture(errors, () => reveal.call(item.element, {
138
+ block: "nearest",
139
+ inline: "nearest"
140
+ }));
141
+ }
142
+ function tokenIncludes(value, token) {
143
+ return value?.split(/\s+/u).includes(token) === true;
144
+ }
145
+ function relatedElement(host, id) {
146
+ const root = host.getRootNode();
147
+ if (typeof root.getElementById === "function") return root.getElementById(id);
148
+ return host.ownerDocument.getElementById(id);
149
+ }
150
+ function validateActiveDescendant(host, item, id, errors) {
151
+ const element = item.element;
152
+ if (!host || !element) return;
153
+ if (element.id !== id || relatedElement(element, id) !== element) {
154
+ errors.push(/* @__PURE__ */ new Error("VIZE_UI_COMPOSITE_NAVIGATION_ID_RELATIONSHIP: active descendant ID must uniquely resolve to its registered element"));
155
+ return;
156
+ }
157
+ if (host.contains(element) || tokenIncludes(host.getAttribute("aria-owns"), id)) return;
158
+ const role = host.getAttribute("role");
159
+ if (role === "combobox" || role === "searchbox" || role === "textbox") {
160
+ const controlledIds = host.getAttribute("aria-controls")?.split(/\s+/u) ?? [];
161
+ for (const controlledId of controlledIds) {
162
+ const controlled = relatedElement(host, controlledId);
163
+ if (controlled?.contains(element) || tokenIncludes(controlled?.getAttribute("aria-owns") ?? null, id)) return;
164
+ }
165
+ }
166
+ errors.push(/* @__PURE__ */ new Error("VIZE_UI_COMPOSITE_NAVIGATION_RELATIONSHIP: active descendant must be contained, aria-owned, or controlled by a supported input role"));
167
+ }
168
+ //#endregion
169
+ //#region src/composite-navigation.ts
170
+ const disposedDiagnostic = "VIZE_UI_COMPOSITE_NAVIGATION_DISPOSED";
171
+ const itemDiagnostic = "VIZE_UI_COMPOSITE_NAVIGATION_ITEM";
172
+ const setupDiagnostic = "VIZE_UI_COMPOSITE_NAVIGATION_SETUP";
173
+ /** Create an SSR-safe roving-tabindex or active-descendant collection adapter. */
174
+ function createCompositeNavigation(options) {
175
+ const strategy = validateOptions(options);
176
+ const registry = options.registry;
177
+ const itemHandlers = /* @__PURE__ */ new Map();
178
+ let container = null;
179
+ let disposed = false;
180
+ const assertActive = () => {
181
+ if (disposed) throw new Error(`${disposedDiagnostic}: the controller has been disposed`);
182
+ };
183
+ const getItem = (key) => {
184
+ const item = registry.getItem(key);
185
+ if (!item) throw new Error(`${itemDiagnostic}: no item is registered for ${String(key)}`);
186
+ return item;
187
+ };
188
+ const effectiveKey = () => registry.activeKey.value ?? registry.navigableItems.value[0]?.key ?? null;
189
+ const itemId = (item) => {
190
+ const getId = options.getItemId;
191
+ const value = getId?.(item) ?? (item.element?.id || void 0);
192
+ if (value === void 0) {
193
+ if (strategy === "active-descendant") throw new Error("VIZE_UI_COMPOSITE_NAVIGATION_ID: active-descendant items require a stable ID");
194
+ return;
195
+ }
196
+ return validateId(value);
197
+ };
198
+ const synchronizeDom = (key, originalEvent, moveDomFocus, errors) => {
199
+ const item = getItem(key);
200
+ if (strategy === "active-descendant") validateActiveDescendant(container, item, itemId(item), errors);
201
+ const preventScroll = strategy === "roving" && readBoolean(options.preventScroll, "preventScroll");
202
+ if (strategy === "roving" && moveDomFocus) focusItem(item.element, preventScroll, errors);
203
+ if (options.scrollIntoView || strategy === "active-descendant" || moveDomFocus && preventScroll) revealItem(item, options.scrollIntoView, originalEvent, errors);
204
+ };
205
+ const notify = (key, previousKey, intent, originalEvent, errors) => {
206
+ const change = Object.freeze({
207
+ key,
208
+ previousKey,
209
+ intent,
210
+ originalEvent,
211
+ focusStrategy: strategy
212
+ });
213
+ capture(errors, () => options.onNavigate?.(change));
214
+ };
215
+ const commit = (mutate, intent, originalEvent, moveDomFocus) => {
216
+ const previousKey = registry.activeKey.value;
217
+ const errors = [];
218
+ capture(errors, mutate);
219
+ const key = registry.activeKey.value;
220
+ if (key !== null && key !== previousKey) {
221
+ capture(errors, () => synchronizeDom(key, originalEvent, moveDomFocus, errors));
222
+ notify(key, previousKey, intent, originalEvent, errors);
223
+ }
224
+ surfaceErrors(errors, "Composite navigation transition failed");
225
+ return key;
226
+ };
227
+ const pageTarget = (intent) => {
228
+ const direction = intent === "page-next" ? "next" : "previous";
229
+ let key = effectiveKey();
230
+ for (let index = 0; index < readPageSize(options.pageSize); index++) {
231
+ const next = registry.getNavigationKey(direction, {
232
+ fromKey: key,
233
+ loop: false
234
+ });
235
+ if (next === null || next === key) break;
236
+ key = next;
237
+ }
238
+ return key;
239
+ };
240
+ const navigate = (intent, originalEvent = null) => {
241
+ assertActive();
242
+ intent = validateCommand(intent);
243
+ if (readBoolean(options.isDisabled, "isDisabled")) return null;
244
+ if (intent === "page-next" || intent === "page-previous") {
245
+ const target = pageTarget(intent);
246
+ if (target === null) return null;
247
+ return commit(() => {
248
+ registry.setActiveKey(target);
249
+ }, intent, originalEvent, strategy === "roving");
250
+ }
251
+ return commit(() => {
252
+ registry.moveActive(intent, { loop: readBoolean(options.loop, "loop") });
253
+ }, intent, originalEvent, strategy === "roving");
254
+ };
255
+ const configuredTypeahead = options.typeahead;
256
+ const typeahead = configuredTypeahead && typeof configuredTypeahead === "object" ? createTypeahead({
257
+ ...configuredTypeahead,
258
+ registry,
259
+ isDisabled: () => readBoolean(options.isDisabled, "isDisabled") || readBoolean(configuredTypeahead.isDisabled, "typeahead.isDisabled"),
260
+ onMatch(match) {
261
+ const errors = [];
262
+ if (match.key !== match.previousKey) {
263
+ capture(errors, () => synchronizeDom(match.key, match.originalEvent, strategy === "roving", errors));
264
+ notify(match.key, match.previousKey, "typeahead", match.originalEvent, errors);
265
+ }
266
+ capture(errors, () => configuredTypeahead.onMatch?.(match));
267
+ surfaceErrors(errors, "Composite typeahead transition failed");
268
+ }
269
+ }) : null;
270
+ const activateItem = (key, event) => {
271
+ if (disposed || readBoolean(options.isDisabled, "isDisabled")) return;
272
+ if (!registry.navigableItems.value.some((item) => item.key === key)) return;
273
+ commit(() => {
274
+ registry.setActiveKey(key);
275
+ }, event.type === "pointerdown" ? "pointer" : "focus", event, false);
276
+ };
277
+ const handlersFor = (key) => {
278
+ const cached = itemHandlers.get(key);
279
+ if (cached) return cached;
280
+ for (const cachedKey of itemHandlers.keys()) if (!registry.getItem(cachedKey)) itemHandlers.delete(cachedKey);
281
+ const handlers = Object.freeze({
282
+ onFocus: (event) => activateItem(key, event),
283
+ onPointerdown: (event) => activateItem(key, event)
284
+ });
285
+ itemHandlers.set(key, handlers);
286
+ return handlers;
287
+ };
288
+ const onFocus = (event) => {
289
+ if (disposed) return;
290
+ container = eventElement(event.currentTarget);
291
+ if (strategy !== "active-descendant" || event.target !== event.currentTarget || readBoolean(options.isDisabled, "isDisabled")) return;
292
+ const key = effectiveKey();
293
+ if (key !== null && registry.activeKey.value === null) commit(() => {
294
+ registry.setActiveKey(key);
295
+ }, "focus", event, false);
296
+ };
297
+ const onKeydown = (event) => {
298
+ if (disposed) return;
299
+ container = eventElement(event.currentTarget);
300
+ if (event.defaultPrevented || isEditableDescendant(event) || readBoolean(options.isDisabled, "isDisabled")) return;
301
+ const intent = keyIntent(event, readOrientation(options.orientation), readDirection(options.direction));
302
+ if (intent && registry.navigableItems.value.length > 0) {
303
+ event.preventDefault();
304
+ navigate(intent, event);
305
+ return;
306
+ }
307
+ typeahead?.typeaheadProps.onKeydown(event);
308
+ };
309
+ return Object.freeze({
310
+ activeKey: registry.activeKey,
311
+ typeahead,
312
+ getContainerProps: () => {
313
+ assertActive();
314
+ const key = effectiveKey();
315
+ const activeDescendant = strategy === "active-descendant" && key !== null ? itemId(getItem(key)) : void 0;
316
+ const props = {
317
+ onFocus,
318
+ onKeydown,
319
+ ...strategy === "active-descendant" ? { tabindex: 0 } : {},
320
+ ...activeDescendant !== void 0 ? { "aria-activedescendant": activeDescendant } : {}
321
+ };
322
+ return Object.freeze(props);
323
+ },
324
+ getItemProps: (key) => {
325
+ assertActive();
326
+ const item = getItem(key);
327
+ const handlers = handlersFor(key);
328
+ const id = itemId(item);
329
+ const props = {
330
+ ...handlers,
331
+ ...id ? { id } : {},
332
+ ...strategy === "roving" ? { tabindex: effectiveKey() === key ? 0 : -1 } : {}
333
+ };
334
+ return Object.freeze(props);
335
+ },
336
+ navigate,
337
+ dispose: () => {
338
+ if (disposed) return;
339
+ disposed = true;
340
+ typeahead?.dispose();
341
+ itemHandlers.clear();
342
+ container = null;
343
+ }
344
+ });
345
+ }
346
+ /** Create a composite adapter disposed with the current Vue effect scope. */
347
+ function useCompositeNavigation(options) {
348
+ if (!getCurrentScope()) throw new Error(`${setupDiagnostic}: use inside component setup or an active effect scope`);
349
+ const controller = createCompositeNavigation(options);
350
+ onScopeDispose(controller.dispose);
351
+ return controller;
352
+ }
353
+ //#endregion
354
+ export { useCompositeNavigation as n, createCompositeNavigation as t };
@@ -0,0 +1,2 @@
1
+ import { a as CompositeDirection, c as CompositeNavigationBaseOptions, d as CompositeNavigationController, f as CompositeNavigationIntent, h as RovingNavigationOptions, i as CompositeContainerProps, l as CompositeNavigationChange, m as CompositeOrientation, n as useCompositeNavigation, o as CompositeFocusStrategy, p as CompositeNavigationOptions, r as ActiveDescendantNavigationOptions, s as CompositeItemProps, t as createCompositeNavigation, u as CompositeNavigationCommand } from "./composite-navigation-QINW9GLy.mjs";
2
+ export { type ActiveDescendantNavigationOptions, type CompositeContainerProps, type CompositeDirection, type CompositeFocusStrategy, type CompositeItemProps, type CompositeNavigationBaseOptions, type CompositeNavigationChange, type CompositeNavigationCommand, type CompositeNavigationController, type CompositeNavigationIntent, type CompositeNavigationOptions, type CompositeOrientation, type RovingNavigationOptions, createCompositeNavigation, useCompositeNavigation };
@@ -0,0 +1,2 @@
1
+ import { n as useCompositeNavigation, t as createCompositeNavigation } from "./composite-navigation-Skx3LZsv.mjs";
2
+ export { createCompositeNavigation, useCompositeNavigation };
@@ -1,2 +1,2 @@
1
- import { i as useControllableState, n as ControllableStateOptions, r as StateUpdate, t as ControllableState } from "./controllable-state-DXsYJ3yl.mjs";
1
+ import { i as useControllableState, n as ControllableStateOptions, r as StateUpdate, t as ControllableState } from "./controllable-state-BtoxKahh.mjs";
2
2
  export { ControllableState, ControllableStateOptions, StateUpdate, useControllableState };
@@ -0,0 +1,119 @@
1
+ import { MaybeRefOrGetter, ShallowRef } from "vue";
2
+
3
+ //#region src/dismissable-layer-types.d.ts
4
+ /** Stable pointing-device family captured from an outside pointer event. */
5
+ type DismissableLayerPointerType = "mouse" | "pen" | "pointer" | "touch" | "virtual";
6
+ /** Outside interaction that can request dismissal. */
7
+ type DismissableLayerOutsideReason = "focus-outside" | "pointer-down-outside";
8
+ /** User action that can request dismissal. */
9
+ type DismissableLayerDismissReason = DismissableLayerOutsideReason | "escape-key";
10
+ /** Preventable, immutable snapshot emitted before a pointer dismissal is committed. */
11
+ interface DismissableLayerPointerDownOutsideEvent {
12
+ readonly type: "pointer-down-outside";
13
+ readonly reason: "pointer-down-outside";
14
+ readonly target: Element;
15
+ readonly originalEvent: PointerEvent | MouseEvent | TouchEvent;
16
+ readonly pointerType: DismissableLayerPointerType;
17
+ readonly x: number | null;
18
+ readonly y: number | null;
19
+ readonly altKey: boolean;
20
+ readonly ctrlKey: boolean;
21
+ readonly metaKey: boolean;
22
+ readonly shiftKey: boolean;
23
+ readonly defaultPrevented: boolean;
24
+ readonly preventDefault: () => void;
25
+ }
26
+ /** Preventable, immutable snapshot emitted before a focus dismissal is committed. */
27
+ interface DismissableLayerFocusOutsideEvent {
28
+ readonly type: "focus-outside";
29
+ readonly reason: "focus-outside";
30
+ readonly target: Element;
31
+ readonly relatedTarget: Element | null;
32
+ readonly originalEvent: FocusEvent;
33
+ readonly defaultPrevented: boolean;
34
+ readonly preventDefault: () => void;
35
+ }
36
+ /** Preventable, immutable snapshot emitted before an Escape dismissal is committed. */
37
+ interface DismissableLayerEscapeKeyDownEvent {
38
+ readonly type: "escape-key";
39
+ readonly reason: "escape-key";
40
+ readonly target: Element | null;
41
+ readonly originalEvent: KeyboardEvent;
42
+ readonly altKey: boolean;
43
+ readonly ctrlKey: boolean;
44
+ readonly metaKey: boolean;
45
+ readonly shiftKey: boolean;
46
+ readonly defaultPrevented: boolean;
47
+ readonly preventDefault: () => void;
48
+ }
49
+ /** Preventable outside interaction snapshot shared by pointer and focus callbacks. */
50
+ type DismissableLayerInteractOutsideEvent = DismissableLayerFocusOutsideEvent | DismissableLayerPointerDownOutsideEvent;
51
+ /** Immutable notification emitted after dismissal has not been prevented. */
52
+ interface DismissableLayerDismissEvent {
53
+ readonly type: "dismiss";
54
+ readonly reason: DismissableLayerDismissReason;
55
+ readonly target: Element | null;
56
+ readonly originalEvent: Event;
57
+ }
58
+ /** Native props to merge onto the rendered layer root. */
59
+ interface DismissableLayerProps {
60
+ readonly "data-vize-dismissable-layer": "";
61
+ }
62
+ /** Native props to merge onto optional rendered branch roots. */
63
+ interface DismissableLayerBranchProps {
64
+ readonly "data-vize-dismissable-branch": "";
65
+ }
66
+ /** Reactive configuration for one dismissable overlay layer. */
67
+ interface DismissableLayerOptions {
68
+ /** Primary layer root. It may be `null` during SSR and before mount. */
69
+ readonly root: MaybeRefOrGetter<Element | null | undefined>;
70
+ /** Portalled or exceptional roots that count as inside this layer. @default [] */
71
+ readonly branches?: MaybeRefOrGetter<readonly Element[] | null | undefined>;
72
+ /** Whether an activated layer participates in the document dismissal stack. @default true */
73
+ readonly enabled?: MaybeRefOrGetter<boolean | undefined>;
74
+ /** Whether outside pointer-down events can request dismissal. @default true */
75
+ readonly outsidePointerDown?: MaybeRefOrGetter<boolean | undefined>;
76
+ /** Whether outside focus movement can request dismissal. @default true */
77
+ readonly outsideFocus?: MaybeRefOrGetter<boolean | undefined>;
78
+ /** Whether non-composing Escape keydown can request dismissal. @default true */
79
+ readonly escapeKey?: MaybeRefOrGetter<boolean | undefined>;
80
+ /** Called before an outside pointer-down dismissal is committed. */
81
+ readonly onPointerDownOutside?: (event: DismissableLayerPointerDownOutsideEvent) => void;
82
+ /** Called before an outside focus dismissal is committed. */
83
+ readonly onFocusOutside?: (event: DismissableLayerFocusOutsideEvent) => void;
84
+ /** Called for every outside pointer or focus interaction before dismissal is committed. */
85
+ readonly onInteractOutside?: (event: DismissableLayerInteractOutsideEvent) => void;
86
+ /** Called before an Escape dismissal is committed. */
87
+ readonly onEscapeKeyDown?: (event: DismissableLayerEscapeKeyDownEvent) => void;
88
+ /** Called after a top-layer dismissal request has not been prevented. */
89
+ readonly onDismiss?: (event: DismissableLayerDismissEvent) => void;
90
+ }
91
+ /** Lifecycle, state, and root/branch props for one dismissable layer. */
92
+ interface DismissableLayerController {
93
+ /** Whether this controller has been activated, independently of reactive enablement. */
94
+ readonly isActive: Readonly<ShallowRef<boolean>>;
95
+ /** Whether this layer is the enabled, connected, topmost owner in its document. */
96
+ readonly isTopLayer: Readonly<ShallowRef<boolean>>;
97
+ /** Stable native props to merge onto the rendered layer root. */
98
+ readonly layerProps: Readonly<DismissableLayerProps>;
99
+ /** Stable native props to merge onto optional rendered branch roots. */
100
+ readonly branchProps: Readonly<DismissableLayerBranchProps>;
101
+ /** Register an imperative branch and receive an idempotent release function. */
102
+ readonly registerBranch: (branch: Element) => () => void;
103
+ /** Join the document dismissal stack. Safe to call repeatedly. */
104
+ readonly activate: () => void;
105
+ /** Leave the document dismissal stack. */
106
+ readonly deactivate: () => void;
107
+ /** Re-read roots and options after imperative DOM movement. */
108
+ readonly refresh: () => void;
109
+ /** Permanently release reactive and document-level ownership. */
110
+ readonly dispose: () => void;
111
+ }
112
+ //#endregion
113
+ //#region src/dismissable-layer.d.ts
114
+ /** Create an SSR-safe, document-scoped dismissal layer for overlays and popups. */
115
+ declare function createDismissableLayer(options: DismissableLayerOptions): DismissableLayerController;
116
+ /** Create, mount-activate, and scope-dispose a dismissable overlay layer. */
117
+ declare function useDismissableLayer(options: DismissableLayerOptions): DismissableLayerController;
118
+ //#endregion
119
+ export { DismissableLayerDismissEvent as a, DismissableLayerFocusOutsideEvent as c, DismissableLayerOutsideReason as d, DismissableLayerPointerDownOutsideEvent as f, DismissableLayerController as i, DismissableLayerInteractOutsideEvent as l, DismissableLayerProps as m, useDismissableLayer as n, DismissableLayerDismissReason as o, DismissableLayerPointerType as p, DismissableLayerBranchProps as r, DismissableLayerEscapeKeyDownEvent as s, createDismissableLayer as t, DismissableLayerOptions as u };