@vaadin/accordion 25.3.0-alpha4 → 25.3.0-alpha5

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.
@@ -154,6 +154,16 @@
154
154
  "description": "A mixin providing common accordion functionality.",
155
155
  "name": "AccordionMixin",
156
156
  "members": [
157
+ {
158
+ "kind": "field",
159
+ "name": "headingLevel",
160
+ "privacy": "public",
161
+ "type": {
162
+ "text": "number"
163
+ },
164
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
165
+ "attribute": "heading-level"
166
+ },
157
167
  {
158
168
  "kind": "field",
159
169
  "name": "items",
@@ -177,6 +187,14 @@
177
187
  }
178
188
  ],
179
189
  "attributes": [
190
+ {
191
+ "name": "heading-level",
192
+ "type": {
193
+ "text": "number"
194
+ },
195
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
196
+ "fieldName": "headingLevel"
197
+ },
180
198
  {
181
199
  "name": "opened",
182
200
  "type": {
@@ -521,6 +539,20 @@
521
539
  "description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nAccordion does not have own stylable shadow parts or state attributes. Instead, apply styles to\nthe following components:\n\n- [`<vaadin-accordion-heading>`](#/elements/vaadin-accordion-heading)\n- [`<vaadin-accordion-panel>`](#/elements/vaadin-accordion-panel)\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
522
540
  "name": "Accordion",
523
541
  "members": [
542
+ {
543
+ "kind": "field",
544
+ "name": "headingLevel",
545
+ "privacy": "public",
546
+ "type": {
547
+ "text": "number"
548
+ },
549
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
550
+ "attribute": "heading-level",
551
+ "inheritedFrom": {
552
+ "name": "AccordionMixin",
553
+ "module": "src/vaadin-accordion-mixin.js"
554
+ }
555
+ },
524
556
  {
525
557
  "kind": "field",
526
558
  "name": "items",
@@ -592,6 +624,18 @@
592
624
  "tagName": "vaadin-accordion",
593
625
  "customElement": true,
594
626
  "attributes": [
627
+ {
628
+ "name": "heading-level",
629
+ "type": {
630
+ "text": "number"
631
+ },
632
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
633
+ "fieldName": "headingLevel",
634
+ "inheritedFrom": {
635
+ "name": "AccordionMixin",
636
+ "module": "src/vaadin-accordion-mixin.js"
637
+ }
638
+ },
595
639
  {
596
640
  "name": "opened",
597
641
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/accordion",
3
- "version": "25.3.0-alpha4",
3
+ "version": "25.3.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,18 +35,18 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.3.0-alpha4",
39
- "@vaadin/component-base": "25.3.0-alpha4",
40
- "@vaadin/details": "25.3.0-alpha4",
41
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha4",
38
+ "@vaadin/a11y-base": "25.3.0-alpha5",
39
+ "@vaadin/component-base": "25.3.0-alpha5",
40
+ "@vaadin/details": "25.3.0-alpha5",
41
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha5",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/aura": "25.3.0-alpha4",
46
- "@vaadin/chai-plugins": "25.3.0-alpha4",
47
- "@vaadin/test-runner-commands": "25.3.0-alpha4",
45
+ "@vaadin/aura": "25.3.0-alpha5",
46
+ "@vaadin/chai-plugins": "25.3.0-alpha5",
47
+ "@vaadin/test-runner-commands": "25.3.0-alpha5",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha4",
49
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha5",
50
50
  "sinon": "^22.0.0"
51
51
  },
52
52
  "customElements": "custom-elements.json",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "ff0efcd52d3b8a081e8101d36cf7bef65ed71cb1"
57
+ "gitHead": "0be2142cd8b95a562d58735033f947f7109103ab"
58
58
  }
@@ -21,6 +21,18 @@ export declare class AccordionMixinClass {
21
21
  */
22
22
  opened: number | null;
23
23
 
24
+ /**
25
+ * The ARIA heading level, used to set the `aria-level` attribute
26
+ * on the `<vaadin-accordion-heading>` element of each panel.
27
+ *
28
+ * By default, no `aria-level` is set and the headings are announced by
29
+ * screen readers using their default level. Set this property to expose
30
+ * the headings at the level that matches the surrounding page structure.
31
+ *
32
+ * @attr {number} heading-level
33
+ */
34
+ headingLevel: number | null | undefined;
35
+
24
36
  /**
25
37
  * The list of `<vaadin-accordion-panel>` child elements.
26
38
  * It is populated from the elements passed to the light DOM,
@@ -26,6 +26,20 @@ export const AccordionMixin = (superClass) =>
26
26
  reflectToAttribute: true,
27
27
  },
28
28
 
29
+ /**
30
+ * The ARIA heading level, used to set the `aria-level` attribute
31
+ * on the `<vaadin-accordion-heading>` element of each panel.
32
+ *
33
+ * By default, no `aria-level` is set and the headings are announced by
34
+ * screen readers using their default level. Set this property to expose
35
+ * the headings at the level that matches the surrounding page structure.
36
+ *
37
+ * @attr {number} heading-level
38
+ */
39
+ headingLevel: {
40
+ type: Number,
41
+ },
42
+
29
43
  /**
30
44
  * The list of `<vaadin-accordion-panel>` child elements.
31
45
  * It is populated from the elements passed to the light DOM,
@@ -87,6 +101,17 @@ export const AccordionMixin = (superClass) =>
87
101
  });
88
102
  }
89
103
 
104
+ /** @protected */
105
+ updated(props) {
106
+ super.updated(props);
107
+
108
+ if (props.has('items') || props.has('headingLevel')) {
109
+ (this.items || []).forEach((item) => {
110
+ item._headingLevel = this.headingLevel;
111
+ });
112
+ }
113
+ }
114
+
90
115
  /**
91
116
  * Override method inherited from `KeyboardDirectionMixin`
92
117
  * to use the stored list of accordion panels as items.
@@ -24,6 +24,16 @@ export const AccordionPanelMixin = (superClass) =>
24
24
  type: String,
25
25
  observer: '_summaryChanged',
26
26
  },
27
+
28
+ /**
29
+ * The ARIA heading level for the panel heading, propagated from the
30
+ * `headingLevel` property of the parent `<vaadin-accordion>`.
31
+ *
32
+ * @protected
33
+ */
34
+ _headingLevel: {
35
+ type: Number,
36
+ },
27
37
  };
28
38
  }
29
39
 
@@ -32,7 +42,7 @@ export const AccordionPanelMixin = (superClass) =>
32
42
  }
33
43
 
34
44
  static get delegateProps() {
35
- return ['disabled', 'opened', '_theme'];
45
+ return ['disabled', 'opened', '_theme', '_headingLevel'];
36
46
  }
37
47
 
38
48
  constructor() {
@@ -91,6 +101,11 @@ export const AccordionPanelMixin = (superClass) =>
91
101
  return;
92
102
  }
93
103
 
104
+ if (name === '_headingLevel') {
105
+ this._delegateAttribute('aria-level', value);
106
+ return;
107
+ }
108
+
94
109
  super._delegateProperty(name, value);
95
110
  }
96
111
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/accordion",
4
- "version": "25.3.0-alpha4",
4
+ "version": "25.3.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -165,8 +165,17 @@
165
165
  },
166
166
  {
167
167
  "name": "vaadin-accordion",
168
- "description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nAccordion does not have own stylable shadow parts or state attributes. Instead, apply styles to\nthe following components:\n\n- [`<vaadin-accordion-heading>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha4/#/elements/vaadin-accordion-heading)\n- [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha4/#/elements/vaadin-accordion-panel)\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
168
+ "description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nAccordion does not have own stylable shadow parts or state attributes. Instead, apply styles to\nthe following components:\n\n- [`<vaadin-accordion-heading>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha5/#/elements/vaadin-accordion-heading)\n- [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha5/#/elements/vaadin-accordion-panel)\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
169
169
  "attributes": [
170
+ {
171
+ "name": "heading-level",
172
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
173
+ "value": {
174
+ "type": [
175
+ "number"
176
+ ]
177
+ }
178
+ },
170
179
  {
171
180
  "name": "opened",
172
181
  "description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",
@@ -190,6 +199,15 @@
190
199
  ],
191
200
  "js": {
192
201
  "properties": [
202
+ {
203
+ "name": "headingLevel",
204
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
205
+ "value": {
206
+ "type": [
207
+ "number"
208
+ ]
209
+ }
210
+ },
193
211
  {
194
212
  "name": "opened",
195
213
  "description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/accordion",
4
- "version": "25.3.0-alpha4",
4
+ "version": "25.3.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -79,9 +79,16 @@
79
79
  },
80
80
  {
81
81
  "name": "vaadin-accordion",
82
- "description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nAccordion does not have own stylable shadow parts or state attributes. Instead, apply styles to\nthe following components:\n\n- [`<vaadin-accordion-heading>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha4/#/elements/vaadin-accordion-heading)\n- [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha4/#/elements/vaadin-accordion-panel)\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
82
+ "description": "`<vaadin-accordion>` is a Web Component implementing accordion widget:\na vertically stacked set of expandable panels. The component should be\nused as a wrapper for two or more `<vaadin-accordion-panel>` components.\n\nPanel headings function as controls that enable users to open (expand)\nor hide (collapse) their associated sections of content. The user can\ntoggle panels by mouse click, Enter and Space keys.\n\nOnly one panel can be opened at a time, opening a new one forces\nprevious panel to close and hide its content.\n\n```html\n<vaadin-accordion>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 1</vaadin-accordion-heading>\n <div>This panel is opened, so the text is visible by default.</div>\n </vaadin-accordion-panel>\n <vaadin-accordion-panel>\n <vaadin-accordion-heading slot=\"summary\">Panel 2</vaadin-accordion-heading>\n <div>After opening this panel, the first one becomes closed.</div>\n </vaadin-accordion-panel>\n</vaadin-accordion>\n```\n\n### Styling\n\nAccordion does not have own stylable shadow parts or state attributes. Instead, apply styles to\nthe following components:\n\n- [`<vaadin-accordion-heading>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha5/#/elements/vaadin-accordion-heading)\n- [`<vaadin-accordion-panel>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha5/#/elements/vaadin-accordion-panel)\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
83
83
  "extension": true,
84
84
  "attributes": [
85
+ {
86
+ "name": ".headingLevel",
87
+ "description": "The ARIA heading level, used to set the `aria-level` attribute\non the `<vaadin-accordion-heading>` element of each panel.\n\nBy default, no `aria-level` is set and the headings are announced by\nscreen readers using their default level. Set this property to expose\nthe headings at the level that matches the surrounding page structure.",
88
+ "value": {
89
+ "kind": "expression"
90
+ }
91
+ },
85
92
  {
86
93
  "name": ".opened",
87
94
  "description": "The index of currently opened panel. First panel is opened by\ndefault. Only one panel can be opened at the same time.\nSetting null or undefined closes all the accordion panels.",