@sit-onyx/headless 1.0.0-beta.21 → 1.0.0-beta.22

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 (86) hide show
  1. package/dist/composables/comboBox/SelectOnlyCombobox.d.vue.ts +299 -0
  2. package/dist/composables/comboBox/TestCombobox.ct.d.ts +1 -0
  3. package/dist/composables/comboBox/TestCombobox.d.vue.ts +299 -0
  4. package/dist/composables/comboBox/createComboBox.d.ts +370 -0
  5. package/dist/composables/comboBox/createComboBox.testing.d.ts +10 -0
  6. package/dist/composables/helpers/useDismissible.d.ts +10 -0
  7. package/dist/composables/helpers/useGlobalListener.d.ts +10 -0
  8. package/dist/composables/helpers/useGlobalListener.spec.d.ts +1 -0
  9. package/dist/composables/helpers/useOutsideClick.d.ts +26 -0
  10. package/dist/composables/helpers/useOutsideClick.spec.d.ts +1 -0
  11. package/dist/composables/helpers/useTypeAhead.d.ts +11 -0
  12. package/dist/composables/helpers/useTypeAhead.spec.d.ts +1 -0
  13. package/dist/composables/listbox/TestListbox.ct.d.ts +1 -0
  14. package/dist/composables/listbox/TestListbox.d.vue.ts +2 -0
  15. package/dist/composables/listbox/createListbox.d.ts +102 -0
  16. package/dist/composables/listbox/createListbox.testing.d.ts +24 -0
  17. package/dist/composables/menuButton/TestMenuButton.ct.d.ts +1 -0
  18. package/dist/composables/menuButton/TestMenuButton.d.vue.ts +2 -0
  19. package/dist/composables/menuButton/createMenuButton.d.ts +78 -0
  20. package/dist/composables/menuButton/createMenuButton.testing.d.ts +24 -0
  21. package/dist/composables/navigationMenu/TestMenu.ct.d.ts +1 -0
  22. package/dist/composables/navigationMenu/TestMenu.d.vue.ts +2 -0
  23. package/dist/composables/navigationMenu/createMenu.d.ts +21 -0
  24. package/dist/composables/navigationMenu/createMenu.testing.d.ts +16 -0
  25. package/dist/composables/tabs/TestTabs.ct.d.ts +1 -0
  26. package/dist/composables/tabs/TestTabs.d.vue.ts +2 -0
  27. package/dist/composables/tabs/createTabs.d.ts +48 -0
  28. package/dist/composables/tabs/createTabs.testing.d.ts +13 -0
  29. package/dist/composables/tooltip/createToggletip.d.ts +36 -0
  30. package/dist/composables/tooltip/createTooltip.d.ts +42 -0
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +1088 -0
  33. package/dist/playwright.d.ts +5 -0
  34. package/dist/playwright.js +369 -0
  35. package/dist/utils/builder.d.ts +85 -0
  36. package/dist/utils/keyboard.d.ts +26 -0
  37. package/dist/utils/keyboard.spec.d.ts +1 -0
  38. package/dist/utils/math.d.ts +6 -0
  39. package/dist/utils/math.spec.d.ts +1 -0
  40. package/dist/utils/object.d.ts +5 -0
  41. package/dist/utils/object.spec.d.ts +1 -0
  42. package/dist/utils/timer.d.ts +10 -0
  43. package/{src/utils/types.ts → dist/utils/types.d.ts} +4 -12
  44. package/dist/utils/vitest.d.ts +12 -0
  45. package/package.json +16 -7
  46. package/src/composables/comboBox/SelectOnlyCombobox.vue +0 -90
  47. package/src/composables/comboBox/TestCombobox.ct.tsx +0 -24
  48. package/src/composables/comboBox/TestCombobox.vue +0 -84
  49. package/src/composables/comboBox/createComboBox.testing.ts +0 -168
  50. package/src/composables/comboBox/createComboBox.ts +0 -280
  51. package/src/composables/helpers/useDismissible.ts +0 -19
  52. package/src/composables/helpers/useGlobalListener.spec.ts +0 -93
  53. package/src/composables/helpers/useGlobalListener.ts +0 -64
  54. package/src/composables/helpers/useOutsideClick.spec.ts +0 -117
  55. package/src/composables/helpers/useOutsideClick.ts +0 -69
  56. package/src/composables/helpers/useTypeAhead.spec.ts +0 -29
  57. package/src/composables/helpers/useTypeAhead.ts +0 -26
  58. package/src/composables/listbox/TestListbox.ct.tsx +0 -17
  59. package/src/composables/listbox/TestListbox.vue +0 -92
  60. package/src/composables/listbox/createListbox.testing.ts +0 -141
  61. package/src/composables/listbox/createListbox.ts +0 -234
  62. package/src/composables/menuButton/TestMenuButton.ct.tsx +0 -14
  63. package/src/composables/menuButton/TestMenuButton.vue +0 -29
  64. package/src/composables/menuButton/createMenuButton.testing.ts +0 -91
  65. package/src/composables/menuButton/createMenuButton.ts +0 -206
  66. package/src/composables/navigationMenu/TestMenu.ct.tsx +0 -12
  67. package/src/composables/navigationMenu/TestMenu.vue +0 -16
  68. package/src/composables/navigationMenu/createMenu.testing.ts +0 -37
  69. package/src/composables/navigationMenu/createMenu.ts +0 -55
  70. package/src/composables/tabs/TestTabs.ct.tsx +0 -12
  71. package/src/composables/tabs/TestTabs.vue +0 -28
  72. package/src/composables/tabs/createTabs.testing.ts +0 -151
  73. package/src/composables/tabs/createTabs.ts +0 -129
  74. package/src/composables/tooltip/createToggletip.ts +0 -58
  75. package/src/composables/tooltip/createTooltip.ts +0 -71
  76. package/src/index.ts +0 -11
  77. package/src/playwright.ts +0 -5
  78. package/src/utils/builder.ts +0 -135
  79. package/src/utils/keyboard.spec.ts +0 -53
  80. package/src/utils/keyboard.ts +0 -351
  81. package/src/utils/math.spec.ts +0 -14
  82. package/src/utils/math.ts +0 -6
  83. package/src/utils/object.spec.ts +0 -33
  84. package/src/utils/object.ts +0 -8
  85. package/src/utils/timer.ts +0 -22
  86. package/src/utils/vitest.ts +0 -36
@@ -0,0 +1,370 @@
1
+ import { MaybeRef, Ref } from 'vue';
2
+ import { PressedKey } from '../../utils/keyboard.js';
3
+ import { Nullable } from '../../utils/types.js';
4
+ import { CreateListboxOptions, ListboxValue } from '../listbox/createListbox.js';
5
+ /** See https://w3c.github.io/aria/#aria-autocomplete */
6
+ export type ComboboxAutoComplete = "none" | "list" | "both";
7
+ export declare const OPENING_KEYS: PressedKey[];
8
+ export declare const CLOSING_KEYS: PressedKey[];
9
+ export type CreateComboboxOptions<TValue extends ListboxValue, TAutoComplete extends ComboboxAutoComplete, TMultiple extends boolean = false> = {
10
+ autocomplete: MaybeRef<TAutoComplete>;
11
+ label: MaybeRef<string>;
12
+ /**
13
+ * Labels the listbox which displays the available options. E.g. the list label could be "Countries" for a combobox which is labelled "Country".
14
+ */
15
+ listLabel: MaybeRef<string>;
16
+ /**
17
+ * Provides additional description for the listbox which displays the available options.
18
+ */
19
+ listDescription?: MaybeRef<Nullable<string>>;
20
+ /**
21
+ * Controls the opened/visible state of the associated pop-up. When expanded the activeOption can be controlled via the keyboard.
22
+ */
23
+ isExpanded: MaybeRef<boolean>;
24
+ /**
25
+ * If expanded, the active option is the currently highlighted option of the controlled listbox.
26
+ */
27
+ activeOption: Ref<Nullable<TValue>>;
28
+ /**
29
+ * Template ref to the component root (required to close combobox on outside click).
30
+ */
31
+ templateRef: Ref<Nullable<HTMLElement>>;
32
+ /**
33
+ * Hook when the popover should toggle.
34
+ *
35
+ * @param preventFocus If `true`, the parent combobox should not be focused (e.g. on outside click).
36
+ */
37
+ onToggle?: (preventFocus?: boolean) => void;
38
+ /**
39
+ * Hook when an option is (un-)selected.
40
+ */
41
+ onSelect?: (value: TValue) => void;
42
+ /**
43
+ * Hook when the first option should be activated.
44
+ */
45
+ onActivateFirst?: () => void;
46
+ /**
47
+ * Hook when the last option should be activated.
48
+ */
49
+ onActivateLast?: () => void;
50
+ /**
51
+ * Hook when the next option should be activated.
52
+ */
53
+ onActivateNext?: (currentValue: TValue) => void;
54
+ /**
55
+ * Hook when the previous option should be activated.
56
+ */
57
+ onActivatePrevious?: (currentValue: TValue) => void;
58
+ } & (TAutoComplete extends Exclude<ComboboxAutoComplete, "none"> ? {
59
+ onAutocomplete: (input: string) => void;
60
+ } : {
61
+ onAutocomplete?: undefined;
62
+ }) & (TAutoComplete extends "none" ? {
63
+ onTypeAhead: (input: string) => void;
64
+ } : {
65
+ onTypeAhead?: undefined;
66
+ }) & Pick<CreateListboxOptions<TValue, TMultiple>, "onActivateFirst" | "onActivateLast" | "onActivateNext" | "onActivatePrevious" | "onSelect" | "multiple">;
67
+ export declare const createComboBox: <TValue extends ListboxValue, TAutoComplete extends ComboboxAutoComplete, TMultiple extends boolean = false>(args_0: CreateComboboxOptions<TValue, TAutoComplete, TMultiple>) => {
68
+ elements: {
69
+ option: import('vue').ComputedRef<(data: {
70
+ label: string;
71
+ value: TValue;
72
+ disabled?: boolean;
73
+ selected?: boolean;
74
+ }) => {
75
+ readonly id: string;
76
+ readonly role: "option";
77
+ readonly "aria-label": string;
78
+ readonly "aria-disabled": boolean | undefined;
79
+ readonly "aria-checked": boolean | undefined;
80
+ readonly "aria-selected": boolean | undefined;
81
+ readonly onClick: () => false | void | undefined;
82
+ }>;
83
+ group: import('vue').ComputedRef<(options: {
84
+ label: string;
85
+ }) => {
86
+ role: string;
87
+ "aria-label": string;
88
+ }>;
89
+ /**
90
+ * The listbox associated with the combobox.
91
+ */
92
+ listbox: import('vue').ComputedRef<{
93
+ id: string;
94
+ onMousedown: (e: MouseEvent) => void;
95
+ innerHTML?: string;
96
+ class?: any;
97
+ style?: import('vue').StyleValue;
98
+ accesskey?: string;
99
+ contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only";
100
+ contextmenu?: string;
101
+ dir?: string;
102
+ draggable?: boolean | "true" | "false";
103
+ hidden?: (boolean | "true" | "false") | "" | "hidden" | "until-found";
104
+ inert?: boolean | "true" | "false";
105
+ lang?: string;
106
+ placeholder?: string;
107
+ spellcheck?: boolean | "true" | "false";
108
+ tabindex?: string | number;
109
+ title?: string;
110
+ translate?: "yes" | "no";
111
+ radiogroup?: string;
112
+ role?: string;
113
+ about?: string;
114
+ datatype?: string;
115
+ inlist?: any;
116
+ prefix?: string;
117
+ property?: string;
118
+ resource?: string;
119
+ typeof?: string;
120
+ vocab?: string;
121
+ autocapitalize?: string;
122
+ autocorrect?: string;
123
+ autosave?: string;
124
+ color?: string;
125
+ itemprop?: string;
126
+ itemscope?: boolean | "true" | "false";
127
+ itemtype?: string;
128
+ itemid?: string;
129
+ itemref?: string;
130
+ results?: string | number;
131
+ security?: string;
132
+ unselectable?: "on" | "off";
133
+ inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
134
+ is?: string;
135
+ 'aria-activedescendant'?: string;
136
+ 'aria-atomic'?: boolean | "true" | "false";
137
+ 'aria-autocomplete'?: "none" | "inline" | "list" | "both";
138
+ 'aria-busy'?: boolean | "true" | "false";
139
+ 'aria-checked'?: (boolean | "true" | "false") | "mixed";
140
+ 'aria-colcount'?: string | number;
141
+ 'aria-colindex'?: string | number;
142
+ 'aria-colspan'?: string | number;
143
+ 'aria-controls'?: string;
144
+ 'aria-current'?: (boolean | "true" | "false") | "page" | "step" | "location" | "date" | "time";
145
+ 'aria-describedby'?: string;
146
+ 'aria-details'?: string;
147
+ 'aria-disabled'?: boolean | "true" | "false";
148
+ 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup";
149
+ 'aria-errormessage'?: string;
150
+ 'aria-expanded'?: boolean | "true" | "false";
151
+ 'aria-flowto'?: string;
152
+ 'aria-grabbed'?: boolean | "true" | "false";
153
+ 'aria-haspopup'?: (boolean | "true" | "false") | "menu" | "listbox" | "tree" | "grid" | "dialog";
154
+ 'aria-hidden'?: boolean | "true" | "false";
155
+ 'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling";
156
+ 'aria-keyshortcuts'?: string;
157
+ 'aria-label'?: string;
158
+ 'aria-labelledby'?: string;
159
+ 'aria-level'?: string | number;
160
+ 'aria-live'?: "off" | "assertive" | "polite";
161
+ 'aria-modal'?: boolean | "true" | "false";
162
+ 'aria-multiline'?: boolean | "true" | "false";
163
+ 'aria-multiselectable'?: boolean | "true" | "false";
164
+ 'aria-orientation'?: "horizontal" | "vertical";
165
+ 'aria-owns'?: string;
166
+ 'aria-placeholder'?: string;
167
+ 'aria-posinset'?: string | number;
168
+ 'aria-pressed'?: (boolean | "true" | "false") | "mixed";
169
+ 'aria-readonly'?: boolean | "true" | "false";
170
+ 'aria-relevant'?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals";
171
+ 'aria-required'?: boolean | "true" | "false";
172
+ 'aria-roledescription'?: string;
173
+ 'aria-rowcount'?: string | number;
174
+ 'aria-rowindex'?: string | number;
175
+ 'aria-rowspan'?: string | number;
176
+ 'aria-selected'?: boolean | "true" | "false";
177
+ 'aria-setsize'?: string | number;
178
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other";
179
+ 'aria-valuemax'?: string | number;
180
+ 'aria-valuemin'?: string | number;
181
+ 'aria-valuenow'?: string | number;
182
+ 'aria-valuetext'?: string;
183
+ onCopy?: ((payload: ClipboardEvent) => void) | undefined;
184
+ onCut?: ((payload: ClipboardEvent) => void) | undefined;
185
+ onPaste?: ((payload: ClipboardEvent) => void) | undefined;
186
+ onCompositionend?: ((payload: CompositionEvent) => void) | undefined;
187
+ onCompositionstart?: ((payload: CompositionEvent) => void) | undefined;
188
+ onCompositionupdate?: ((payload: CompositionEvent) => void) | undefined;
189
+ onDrag?: ((payload: DragEvent) => void) | undefined;
190
+ onDragend?: ((payload: DragEvent) => void) | undefined;
191
+ onDragenter?: ((payload: DragEvent) => void) | undefined;
192
+ onDragexit?: ((payload: DragEvent) => void) | undefined;
193
+ onDragleave?: ((payload: DragEvent) => void) | undefined;
194
+ onDragover?: ((payload: DragEvent) => void) | undefined;
195
+ onDragstart?: ((payload: DragEvent) => void) | undefined;
196
+ onDrop?: ((payload: DragEvent) => void) | undefined;
197
+ onFocus?: ((payload: FocusEvent) => void) | undefined;
198
+ onFocusin?: ((payload: FocusEvent) => void) | undefined;
199
+ onFocusout?: ((payload: FocusEvent) => void) | undefined;
200
+ onBlur?: ((payload: FocusEvent) => void) | undefined;
201
+ onChange?: ((payload: Event) => void) | undefined;
202
+ onBeforeinput?: ((payload: Event) => void) | undefined;
203
+ onInput?: ((payload: Event) => void) | undefined;
204
+ onReset?: ((payload: Event) => void) | undefined;
205
+ onSubmit?: ((payload: Event) => void) | undefined;
206
+ onInvalid?: ((payload: Event) => void) | undefined;
207
+ onLoad?: ((payload: Event) => void) | undefined;
208
+ onError?: ((payload: Event) => void) | undefined;
209
+ onKeydown?: ((payload: KeyboardEvent) => void) | undefined;
210
+ onKeypress?: ((payload: KeyboardEvent) => void) | undefined;
211
+ onKeyup?: ((payload: KeyboardEvent) => void) | undefined;
212
+ onAuxclick?: ((payload: MouseEvent) => void) | undefined;
213
+ onClick?: ((payload: MouseEvent) => void) | undefined;
214
+ onContextmenu?: ((payload: MouseEvent) => void) | undefined;
215
+ onDblclick?: ((payload: MouseEvent) => void) | undefined;
216
+ onMouseenter?: ((payload: MouseEvent) => void) | undefined;
217
+ onMouseleave?: ((payload: MouseEvent) => void) | undefined;
218
+ onMousemove?: ((payload: MouseEvent) => void) | undefined;
219
+ onMouseout?: ((payload: MouseEvent) => void) | undefined;
220
+ onMouseover?: ((payload: MouseEvent) => void) | undefined;
221
+ onMouseup?: ((payload: MouseEvent) => void) | undefined;
222
+ onAbort?: ((payload: Event) => void) | undefined;
223
+ onCanplay?: ((payload: Event) => void) | undefined;
224
+ onCanplaythrough?: ((payload: Event) => void) | undefined;
225
+ onDurationchange?: ((payload: Event) => void) | undefined;
226
+ onEmptied?: ((payload: Event) => void) | undefined;
227
+ onEncrypted?: ((payload: Event) => void) | undefined;
228
+ onEnded?: ((payload: Event) => void) | undefined;
229
+ onLoadeddata?: ((payload: Event) => void) | undefined;
230
+ onLoadedmetadata?: ((payload: Event) => void) | undefined;
231
+ onLoadstart?: ((payload: Event) => void) | undefined;
232
+ onPause?: ((payload: Event) => void) | undefined;
233
+ onPlay?: ((payload: Event) => void) | undefined;
234
+ onPlaying?: ((payload: Event) => void) | undefined;
235
+ onProgress?: ((payload: Event) => void) | undefined;
236
+ onRatechange?: ((payload: Event) => void) | undefined;
237
+ onSeeked?: ((payload: Event) => void) | undefined;
238
+ onSeeking?: ((payload: Event) => void) | undefined;
239
+ onStalled?: ((payload: Event) => void) | undefined;
240
+ onSuspend?: ((payload: Event) => void) | undefined;
241
+ onTimeupdate?: ((payload: Event) => void) | undefined;
242
+ onVolumechange?: ((payload: Event) => void) | undefined;
243
+ onWaiting?: ((payload: Event) => void) | undefined;
244
+ onSelect?: ((payload: Event) => void) | undefined;
245
+ onScroll?: ((payload: Event) => void) | undefined;
246
+ onScrollend?: ((payload: Event) => void) | undefined;
247
+ onTouchcancel?: ((payload: TouchEvent) => void) | undefined;
248
+ onTouchend?: ((payload: TouchEvent) => void) | undefined;
249
+ onTouchmove?: ((payload: TouchEvent) => void) | undefined;
250
+ onTouchstart?: ((payload: TouchEvent) => void) | undefined;
251
+ onPointerdown?: ((payload: PointerEvent) => void) | undefined;
252
+ onPointermove?: ((payload: PointerEvent) => void) | undefined;
253
+ onPointerup?: ((payload: PointerEvent) => void) | undefined;
254
+ onPointercancel?: ((payload: PointerEvent) => void) | undefined;
255
+ onPointerenter?: ((payload: PointerEvent) => void) | undefined;
256
+ onPointerleave?: ((payload: PointerEvent) => void) | undefined;
257
+ onPointerover?: ((payload: PointerEvent) => void) | undefined;
258
+ onPointerout?: ((payload: PointerEvent) => void) | undefined;
259
+ onWheel?: ((payload: WheelEvent) => void) | undefined;
260
+ onAnimationstart?: ((payload: AnimationEvent) => void) | undefined;
261
+ onAnimationend?: ((payload: AnimationEvent) => void) | undefined;
262
+ onAnimationiteration?: ((payload: AnimationEvent) => void) | undefined;
263
+ onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
264
+ onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
265
+ ref?: Ref<Element | ({
266
+ $: import('vue').ComponentInternalInstance;
267
+ $data: {};
268
+ $props: {};
269
+ $attrs: {
270
+ [x: string]: unknown;
271
+ };
272
+ $refs: {
273
+ [x: string]: unknown;
274
+ };
275
+ $slots: Readonly<{
276
+ [name: string]: import('vue').Slot<any> | undefined;
277
+ }>;
278
+ $root: import('vue').ComponentPublicInstance | null;
279
+ $parent: import('vue').ComponentPublicInstance | null;
280
+ $host: Element | null;
281
+ $emit: (event: string, ...args: any[]) => void;
282
+ $el: any;
283
+ $options: import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import('vue').ComponentProvideOptions> & {
284
+ beforeCreate?: (() => void) | (() => void)[];
285
+ created?: (() => void) | (() => void)[];
286
+ beforeMount?: (() => void) | (() => void)[];
287
+ mounted?: (() => void) | (() => void)[];
288
+ beforeUpdate?: (() => void) | (() => void)[];
289
+ updated?: (() => void) | (() => void)[];
290
+ activated?: (() => void) | (() => void)[];
291
+ deactivated?: (() => void) | (() => void)[];
292
+ beforeDestroy?: (() => void) | (() => void)[];
293
+ beforeUnmount?: (() => void) | (() => void)[];
294
+ destroyed?: (() => void) | (() => void)[];
295
+ unmounted?: (() => void) | (() => void)[];
296
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
297
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
298
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
299
+ };
300
+ $forceUpdate: () => void;
301
+ $nextTick: typeof import('vue').nextTick;
302
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
303
+ } & Readonly<{}> & Omit<{}, never> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
304
+ $el: Element;
305
+ }) | null, Element | ({
306
+ $: import('vue').ComponentInternalInstance;
307
+ $data: {};
308
+ $props: {};
309
+ $attrs: {
310
+ [x: string]: unknown;
311
+ };
312
+ $refs: {
313
+ [x: string]: unknown;
314
+ };
315
+ $slots: Readonly<{
316
+ [name: string]: import('vue').Slot<any> | undefined;
317
+ }>;
318
+ $root: import('vue').ComponentPublicInstance | null;
319
+ $parent: import('vue').ComponentPublicInstance | null;
320
+ $host: Element | null;
321
+ $emit: (event: string, ...args: any[]) => void;
322
+ $el: any;
323
+ $options: import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import('vue').ComponentProvideOptions> & {
324
+ beforeCreate?: (() => void) | (() => void)[];
325
+ created?: (() => void) | (() => void)[];
326
+ beforeMount?: (() => void) | (() => void)[];
327
+ mounted?: (() => void) | (() => void)[];
328
+ beforeUpdate?: (() => void) | (() => void)[];
329
+ updated?: (() => void) | (() => void)[];
330
+ activated?: (() => void) | (() => void)[];
331
+ deactivated?: (() => void) | (() => void)[];
332
+ beforeDestroy?: (() => void) | (() => void)[];
333
+ beforeUnmount?: (() => void) | (() => void)[];
334
+ destroyed?: (() => void) | (() => void)[];
335
+ unmounted?: (() => void) | (() => void)[];
336
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
337
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
338
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
339
+ };
340
+ $forceUpdate: () => void;
341
+ $nextTick: typeof import('vue').nextTick;
342
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
343
+ } & Readonly<{}> & Omit<{}, never> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
344
+ $el: Element;
345
+ }) | null> | undefined;
346
+ }>;
347
+ /**
348
+ * An input that controls another element, that can dynamically pop-up to help the user set the value of the input.
349
+ * The input MAY be either a single-line text field that supports editing and typing or an element that only displays the current value of the combobox.
350
+ */
351
+ input: import('vue').ComputedRef<{
352
+ "aria-autocomplete"?: TAutoComplete | undefined;
353
+ type?: string | undefined;
354
+ role: string;
355
+ "aria-expanded": boolean;
356
+ "aria-controls": string;
357
+ "aria-label": string;
358
+ "aria-activedescendant": string | undefined;
359
+ onInput: (event: Event) => void;
360
+ onKeydown: (event: KeyboardEvent) => void;
361
+ }>;
362
+ /**
363
+ * An optional button to control the visibility of the popup.
364
+ */
365
+ button: import('vue').ComputedRef<{
366
+ tabindex: string;
367
+ onClick: () => void | undefined;
368
+ }>;
369
+ };
370
+ };
@@ -0,0 +1,10 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ /**
3
+ * Test an implementation of the combobox based on https://w3c.github.io/aria/#combobox
4
+ */
5
+ export declare const comboboxTesting: (_page: Page, listbox: Locator, combobox: Locator, button: Locator, options: Locator) => Promise<void>;
6
+ export type CheckLocator = (option: Locator) => Promise<boolean>;
7
+ /**
8
+ * Test an implementation of the combobox based on https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
9
+ */
10
+ export declare const comboboxSelectOnlyTesting: (page: Page, listbox: Locator, combobox: Locator, isActive: CheckLocator) => Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ type UseDismissibleOptions = {
3
+ isExpanded: Ref<boolean>;
4
+ };
5
+ /**
6
+ * Composable that sets `isExpanded` to false, when the `Escape` key is pressed.
7
+ * Addresses the "dismissible" aspect of https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html
8
+ */
9
+ export declare const useDismissible: ({ isExpanded }: UseDismissibleOptions) => void;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ type DocumentEventType = keyof DocumentEventMap;
3
+ type GlobalListener<K extends DocumentEventType = DocumentEventType> = (event: DocumentEventMap[K]) => unknown;
4
+ export type UseGlobalEventListenerOptions<K extends DocumentEventType> = {
5
+ type: K;
6
+ listener: GlobalListener<K>;
7
+ disabled?: Ref<boolean>;
8
+ };
9
+ export declare const useGlobalEventListener: <K extends DocumentEventType>({ type, listener, disabled, }: UseGlobalEventListenerOptions<K>) => void;
10
+ export {};
@@ -0,0 +1,26 @@
1
+ import { Arrayable } from 'vitest';
2
+ import { MaybeRefOrGetter, Ref } from 'vue';
3
+ import { Nullable } from '../../utils/types.js';
4
+ export type UseOutsideClickOptions<TCheckOnTab extends boolean | undefined = undefined> = {
5
+ /**
6
+ * HTML element of the component where clicks should be ignored
7
+ */
8
+ inside: MaybeRefOrGetter<Arrayable<Nullable<HTMLElement>>>;
9
+ /**
10
+ * Callback when an outside click occurred.
11
+ */
12
+ onOutsideClick: (event: TCheckOnTab extends true ? MouseEvent | KeyboardEvent : MouseEvent) => void;
13
+ /**
14
+ * Whether the outside focus should also be checked when pressing the Tab key.
15
+ */
16
+ checkOnTab?: TCheckOnTab;
17
+ /**
18
+ * If `true`, event listeners will be removed and no outside clicks will be captured.
19
+ */
20
+ disabled?: Ref<boolean>;
21
+ };
22
+ /**
23
+ * Composable for listening to click events that occur outside of a component.
24
+ * Useful to e.g. close flyouts or tooltips.
25
+ */
26
+ export declare const useOutsideClick: <TCheckOnTab extends boolean | undefined>({ inside, onOutsideClick, disabled, checkOnTab, }: UseOutsideClickOptions<TCheckOnTab>) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Enhances typeAhead to combine multiple inputs in quick succession and filter out non-printable characters.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const typeAhead = useTypeAhead((inputString) => console.log("Typed string:", inputString));
7
+ * // ...
8
+ * addEventListener("keydown", typeAhead);
9
+ * ```
10
+ */
11
+ export declare const useTypeAhead: (callback: (input: string) => void, timeout?: number) => (event: Pick<KeyboardEvent, "key">) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLUListElement>;
2
+ export default _default;
@@ -0,0 +1,102 @@
1
+ import { MaybeRef, Ref } from 'vue';
2
+ import { VBindAttributes } from '../../utils/builder.js';
3
+ import { Nullable } from '../../utils/types.js';
4
+ export type ListboxValue = string | number | boolean;
5
+ export type CreateListboxOptions<TValue extends ListboxValue, TMultiple extends boolean = false> = {
6
+ /**
7
+ * Aria label for the listbox.
8
+ */
9
+ label: MaybeRef<string>;
10
+ /**
11
+ * Aria description for the listbox.
12
+ */
13
+ description?: MaybeRef<Nullable<string>>;
14
+ /**
15
+ * Value of currently (visually) active option.
16
+ */
17
+ activeOption: Ref<Nullable<TValue>>;
18
+ /**
19
+ * Wether the listbox is controlled from the outside, e.g. by a combobox.
20
+ * This disables keyboard events and makes the listbox not focusable.
21
+ */
22
+ controlled?: boolean;
23
+ /**
24
+ * Controls the opened/visible state of the listbox. When expanded the activeOption can be controlled via the keyboard.
25
+ */
26
+ isExpanded?: MaybeRef<boolean>;
27
+ /**
28
+ * Whether the listbox is multiselect.
29
+ */
30
+ multiple?: MaybeRef<Nullable<TMultiple>>;
31
+ /**
32
+ * Hook when an option is selected.
33
+ */
34
+ onSelect?: (value: TValue) => void;
35
+ /**
36
+ * Hook when the first option should be activated.
37
+ */
38
+ onActivateFirst?: () => void;
39
+ /**
40
+ * Hook when the last option should be activated.
41
+ */
42
+ onActivateLast?: () => void;
43
+ /**
44
+ * Hook when the next option should be activated.
45
+ */
46
+ onActivateNext?: (currentValue: TValue) => void;
47
+ /**
48
+ * Hook when the previous option should be activated.
49
+ */
50
+ onActivatePrevious?: (currentValue: TValue) => void;
51
+ /**
52
+ * Hook when the first option starting with the given label should be activated.
53
+ */
54
+ onTypeAhead?: (key: string) => void;
55
+ } & ({
56
+ /**
57
+ * Optional aria label for the listbox.
58
+ */
59
+ label?: MaybeRef<string>;
60
+ /**
61
+ * Wether the listbox is controlled from the outside, e.g. by a combobox.
62
+ * This disables keyboard events and makes the listbox not focusable.
63
+ */
64
+ controlled: true;
65
+ } | {
66
+ /**
67
+ * Aria label for the listbox.
68
+ */
69
+ label: MaybeRef<string>;
70
+ controlled?: false;
71
+ });
72
+ /**
73
+ * Composable for creating a accessibility-conform listbox.
74
+ * For supported keyboard shortcuts, see: https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-scrollable/
75
+ */
76
+ export declare const createListbox: <TValue extends ListboxValue, TMultiple extends boolean = false>(options: CreateListboxOptions<TValue, TMultiple>) => import('../../utils/builder.js').HeadlessComposable<{
77
+ listbox: import('vue').ComputedRef<VBindAttributes>;
78
+ group: import('vue').ComputedRef<(options: {
79
+ label: string;
80
+ }) => {
81
+ role: string;
82
+ "aria-label": string;
83
+ }>;
84
+ option: import('vue').ComputedRef<(data: {
85
+ label: string;
86
+ value: TValue;
87
+ disabled?: boolean;
88
+ selected?: boolean;
89
+ }) => {
90
+ readonly id: string;
91
+ readonly role: "option";
92
+ readonly "aria-label": string;
93
+ readonly "aria-disabled": boolean | undefined;
94
+ readonly "aria-checked": boolean | undefined;
95
+ readonly "aria-selected": boolean | undefined;
96
+ readonly onClick: () => false | void | undefined;
97
+ }>;
98
+ }, {
99
+ isFocused: Ref<boolean, boolean>;
100
+ }, {
101
+ getOptionId: (value: TValue) => string;
102
+ }>;
@@ -0,0 +1,24 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ export type ListboxTestingOptions = {
3
+ /**
4
+ * Playwright page.
5
+ */
6
+ page: Page;
7
+ /**
8
+ * Locator for the listbox element.
9
+ */
10
+ listbox: Locator;
11
+ /**
12
+ * Options (at least 3).
13
+ */
14
+ options: Locator;
15
+ /**
16
+ * Function that returns whether the given option locator is visually active.
17
+ */
18
+ isOptionActive: (locator: Locator) => Promise<boolean>;
19
+ };
20
+ /**
21
+ * Playwright utility for executing accessibility testing for a listbox.
22
+ * Will check aria attributes and keyboard shortcuts as defined in https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-scrollable.
23
+ */
24
+ export declare const listboxTesting: ({ page, listbox, options, isOptionActive, }: ListboxTestingOptions) => Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
+ export default _default;