@vaadin/a11y-base 25.2.0-alpha9 → 25.2.0-beta2

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.
@@ -10,7 +10,22 @@
10
10
  "kind": "mixin",
11
11
  "description": "A mixin to toggle the `active` attribute.\n\nThe attribute is set whenever the user activates the element by a pointer\nor presses an activation key on the element from the keyboard.\n\nThe attribute is removed as soon as the element is deactivated\nby the pointer or by releasing the activation key.",
12
12
  "name": "ActiveMixin",
13
- "members": [],
13
+ "members": [
14
+ {
15
+ "kind": "field",
16
+ "name": "disabled",
17
+ "privacy": "public",
18
+ "type": {
19
+ "text": "boolean"
20
+ },
21
+ "description": "If true, the user cannot interact with this element.",
22
+ "attribute": "disabled",
23
+ "inheritedFrom": {
24
+ "name": "DisabledMixin",
25
+ "module": "src/disabled-mixin.js"
26
+ }
27
+ }
28
+ ],
14
29
  "mixins": [
15
30
  {
16
31
  "name": "DisabledMixin",
@@ -25,6 +40,20 @@
25
40
  {
26
41
  "name": "superclass"
27
42
  }
43
+ ],
44
+ "attributes": [
45
+ {
46
+ "name": "disabled",
47
+ "type": {
48
+ "text": "boolean"
49
+ },
50
+ "description": "If true, the user cannot interact with this element.",
51
+ "fieldName": "disabled",
52
+ "inheritedFrom": {
53
+ "name": "DisabledMixin",
54
+ "module": "src/disabled-mixin.js"
55
+ }
56
+ }
28
57
  ]
29
58
  }
30
59
  ],
@@ -44,9 +73,76 @@
44
73
  "path": "src/delegate-focus-mixin.js",
45
74
  "declarations": [
46
75
  {
47
- "kind": "variable",
76
+ "kind": "mixin",
77
+ "description": "",
48
78
  "name": "DelegateFocusMixin",
49
- "description": "A mixin to forward focus to an element in the light DOM."
79
+ "members": [
80
+ {
81
+ "kind": "field",
82
+ "name": "autofocus",
83
+ "privacy": "public",
84
+ "type": {
85
+ "text": "boolean"
86
+ },
87
+ "description": "Specify that this control should have input focus when the page loads.",
88
+ "attribute": "autofocus"
89
+ },
90
+ {
91
+ "kind": "field",
92
+ "name": "disabled",
93
+ "privacy": "public",
94
+ "type": {
95
+ "text": "boolean"
96
+ },
97
+ "description": "If true, the user cannot interact with this element.",
98
+ "attribute": "disabled",
99
+ "inheritedFrom": {
100
+ "name": "DisabledMixin",
101
+ "module": "src/disabled-mixin.js"
102
+ }
103
+ }
104
+ ],
105
+ "attributes": [
106
+ {
107
+ "name": "autofocus",
108
+ "type": {
109
+ "text": "boolean"
110
+ },
111
+ "description": "Specify that this control should have input focus when the page loads.",
112
+ "fieldName": "autofocus"
113
+ },
114
+ {
115
+ "name": "disabled",
116
+ "type": {
117
+ "text": "boolean"
118
+ },
119
+ "description": "If true, the user cannot interact with this element.",
120
+ "fieldName": "disabled",
121
+ "inheritedFrom": {
122
+ "name": "DisabledMixin",
123
+ "module": "src/disabled-mixin.js"
124
+ }
125
+ }
126
+ ],
127
+ "mixins": [
128
+ {
129
+ "name": "FocusMixin",
130
+ "module": "src/focus-mixin.js"
131
+ },
132
+ {
133
+ "name": "TabindexMixin",
134
+ "module": "src/tabindex-mixin.js"
135
+ },
136
+ {
137
+ "name": "dedupeMixin",
138
+ "package": "@open-wc/dedupe-mixin"
139
+ }
140
+ ],
141
+ "parameters": [
142
+ {
143
+ "name": "superclass"
144
+ }
145
+ ]
50
146
  }
51
147
  ],
52
148
  "exports": [
@@ -65,9 +161,42 @@
65
161
  "path": "src/disabled-mixin.js",
66
162
  "declarations": [
67
163
  {
68
- "kind": "variable",
164
+ "kind": "mixin",
165
+ "description": "",
69
166
  "name": "DisabledMixin",
70
- "description": "A mixin to provide disabled property for field components."
167
+ "members": [
168
+ {
169
+ "kind": "field",
170
+ "name": "disabled",
171
+ "privacy": "public",
172
+ "type": {
173
+ "text": "boolean"
174
+ },
175
+ "description": "If true, the user cannot interact with this element.",
176
+ "attribute": "disabled"
177
+ }
178
+ ],
179
+ "attributes": [
180
+ {
181
+ "name": "disabled",
182
+ "type": {
183
+ "text": "boolean"
184
+ },
185
+ "description": "If true, the user cannot interact with this element.",
186
+ "fieldName": "disabled"
187
+ }
188
+ ],
189
+ "parameters": [
190
+ {
191
+ "name": "superclass"
192
+ }
193
+ ],
194
+ "mixins": [
195
+ {
196
+ "name": "dedupeMixin",
197
+ "package": "@open-wc/dedupe-mixin"
198
+ }
199
+ ]
71
200
  }
72
201
  ],
73
202
  "exports": [
@@ -86,9 +215,21 @@
86
215
  "path": "src/focus-mixin.js",
87
216
  "declarations": [
88
217
  {
89
- "kind": "variable",
218
+ "kind": "mixin",
219
+ "description": "",
90
220
  "name": "FocusMixin",
91
- "description": "A mixin to handle `focused` and `focus-ring` attributes based on focus."
221
+ "members": [],
222
+ "parameters": [
223
+ {
224
+ "name": "superclass"
225
+ }
226
+ ],
227
+ "mixins": [
228
+ {
229
+ "name": "dedupeMixin",
230
+ "package": "@open-wc/dedupe-mixin"
231
+ }
232
+ ]
92
233
  }
93
234
  ],
94
235
  "exports": [
@@ -140,9 +281,21 @@
140
281
  "path": "src/keyboard-mixin.js",
141
282
  "declarations": [
142
283
  {
143
- "kind": "variable",
284
+ "kind": "mixin",
285
+ "description": "",
144
286
  "name": "KeyboardMixin",
145
- "description": "A mixin that manages keyboard handling.\nThe mixin subscribes to the keyboard events while an actual implementation\nfor the event handlers is left to the client (a component or another mixin)."
287
+ "members": [],
288
+ "parameters": [
289
+ {
290
+ "name": "superclass"
291
+ }
292
+ ],
293
+ "mixins": [
294
+ {
295
+ "name": "dedupeMixin",
296
+ "package": "@open-wc/dedupe-mixin"
297
+ }
298
+ ]
146
299
  }
147
300
  ],
148
301
  "exports": [
@@ -265,8 +418,36 @@
265
418
  "kind": "mixin",
266
419
  "description": "A mixin to toggle the `tabindex` attribute.\n\nThe attribute is set to -1 whenever the user disables the element\nand restored with the last known value once the element is enabled.",
267
420
  "name": "TabindexMixin",
268
- "members": [],
269
- "attributes": [],
421
+ "members": [
422
+ {
423
+ "kind": "field",
424
+ "name": "disabled",
425
+ "privacy": "public",
426
+ "type": {
427
+ "text": "boolean"
428
+ },
429
+ "description": "If true, the user cannot interact with this element.",
430
+ "attribute": "disabled",
431
+ "inheritedFrom": {
432
+ "name": "DisabledMixin",
433
+ "module": "src/disabled-mixin.js"
434
+ }
435
+ }
436
+ ],
437
+ "attributes": [
438
+ {
439
+ "name": "disabled",
440
+ "type": {
441
+ "text": "boolean"
442
+ },
443
+ "description": "If true, the user cannot interact with this element.",
444
+ "fieldName": "disabled",
445
+ "inheritedFrom": {
446
+ "name": "DisabledMixin",
447
+ "module": "src/disabled-mixin.js"
448
+ }
449
+ }
450
+ ],
270
451
  "mixins": [
271
452
  {
272
453
  "name": "DisabledMixin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/a11y-base",
3
- "version": "25.2.0-alpha9",
3
+ "version": "25.2.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,15 +32,15 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@open-wc/dedupe-mixin": "^1.3.0",
35
- "@vaadin/component-base": "25.2.0-alpha9",
35
+ "@vaadin/component-base": "25.2.0-beta2",
36
36
  "lit": "^3.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@vaadin/chai-plugins": "25.2.0-alpha9",
40
- "@vaadin/test-runner-commands": "25.2.0-alpha9",
39
+ "@vaadin/chai-plugins": "25.2.0-beta2",
40
+ "@vaadin/test-runner-commands": "25.2.0-beta2",
41
41
  "@vaadin/testing-helpers": "^2.0.0",
42
- "sinon": "^21.0.2"
42
+ "sinon": "^22.0.0"
43
43
  },
44
44
  "customElements": "custom-elements.json",
45
- "gitHead": "a38a03e8a8be45821f39c14054c63634dafe08d0"
45
+ "gitHead": "9e18feb8057baf278b72fec4e42657b19e48f499"
46
46
  }
@@ -32,7 +32,7 @@ export declare class ActiveMixinClass {
32
32
  /**
33
33
  * Override to define if the component needs to be activated.
34
34
  */
35
- protected _shouldSetFocus(event: KeyboardEvent | MouseEvent): boolean;
35
+ protected _shouldSetActive(event: KeyboardEvent | MouseEvent): boolean;
36
36
 
37
37
  /**
38
38
  * Toggles the `active` attribute on the element.
@@ -15,10 +15,6 @@ import { KeyboardMixin } from './keyboard-mixin.js';
15
15
  *
16
16
  * The attribute is removed as soon as the element is deactivated
17
17
  * by the pointer or by releasing the activation key.
18
- *
19
- * @polymerMixin
20
- * @mixes DisabledMixin
21
- * @mixes KeyboardMixin
22
18
  */
23
19
  export const ActiveMixin = (superclass) =>
24
20
  class ActiveMixinClass extends DisabledMixin(KeyboardMixin(superclass)) {
package/src/announce.js CHANGED
@@ -23,7 +23,7 @@ let alertDebouncer;
23
23
  */
24
24
  export function announce(text, options = {}) {
25
25
  const mode = options.mode || 'polite';
26
- const timeout = options.timeout === undefined ? 150 : options.timeout;
26
+ const timeout = options.timeout ?? 150;
27
27
 
28
28
  if (mode === 'alert') {
29
29
  region.removeAttribute('aria-live');
@@ -27,7 +27,7 @@ let lockCount = 0;
27
27
  * @param {?Node} node
28
28
  * @return {boolean}
29
29
  */
30
- const isElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;
30
+ const isElement = (node) => node?.nodeType === Node.ELEMENT_NODE;
31
31
 
32
32
  /**
33
33
  * @param {...unknown} args
@@ -3,13 +3,12 @@
3
3
  * Copyright (c) 2021 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import type { ReactiveController } from 'lit';
7
6
 
8
7
  /**
9
8
  * A controller for handling modal state on the elements with `dialog` and `alertdialog` role.
10
9
  * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-modal
11
10
  */
12
- export class AriaModalController implements ReactiveController {
11
+ export class AriaModalController {
13
12
  /**
14
13
  * The controller host element.
15
14
  */
@@ -21,7 +20,7 @@ export class AriaModalController implements ReactiveController {
21
20
  */
22
21
  callback: () => HTMLElement | HTMLElement[];
23
22
 
24
- constructor(node: HTMLElement);
23
+ constructor(host: HTMLElement, callback?: () => HTMLElement | HTMLElement[]);
25
24
 
26
25
  /**
27
26
  * Make the controller host element modal by trapping focus inside it and hiding