edu-webcomponents 1.26.0 → 1.28.0

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.
package/CHANGELOG.md CHANGED
@@ -4,10 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v1.28.0](https://github.com/eduardocruzpalacios/edu-webcomponents/compare/v1.27.0...v1.28.0)
8
+
9
+ - feat: improve accessibility of EduDivider [`2a082ef`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/2a082ef06b22bc5204930e72a044e2659c6dec9e)
10
+
11
+ #### [v1.27.0](https://github.com/eduardocruzpalacios/edu-webcomponents/compare/v1.26.0...v1.27.0)
12
+
13
+ > 16 January 2026
14
+
15
+ - feat: improve accessibility of EduLoadingSpinner [`7f3a6e9`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/7f3a6e9a8c6ac64caab09b32a2deeb2251ee3a1f)
16
+ - chore: release v1.27.0 [`9c840df`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/9c840df4c053369fe33949d5d63ff902eb2fa82d)
17
+
7
18
  #### [v1.26.0](https://github.com/eduardocruzpalacios/edu-webcomponents/compare/v1.25.0...v1.26.0)
8
19
 
9
- - feat: improve accessibility of EduButton according to 2.5.5 in WCAG 2.1 and 2.4.7 in WCAG 2.2 [`969a143`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/969a143fee573fcb0d93072de73a143a2e2116b6)
20
+ > 14 January 2026
21
+
22
+ - feat: improve accessibility of EduButton according to 2.5.5 in WCAG 2.1 and 2.4.7 in WCAG 2.2 [`3a559f0`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/3a559f02848035a0feed493c573d1c285bf0792c)
10
23
  - refactor: code [`65c723d`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/65c723dc344e9b8bb9da515b76e465c21eab3097)
24
+ - chore: release v1.26.0 [`0ed337c`](https://github.com/eduardocruzpalacios/edu-webcomponents/commit/0ed337c4ff2a0d6d98ba52225f3d47dfdba69e33)
11
25
 
12
26
  #### [v1.25.0](https://github.com/eduardocruzpalacios/edu-webcomponents/compare/v1.24.0...v1.25.0)
13
27
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "license": "MIT",
13
13
  "author": "edu-webcomponents",
14
- "version": "1.26.0",
14
+ "version": "1.28.0",
15
15
  "repository": {
16
16
  "type": "git",
17
17
  "url": "https://github.com/eduardocruzpalacios/edu-webcomponents"
@@ -7,9 +7,9 @@ export default {
7
7
  };
8
8
 
9
9
  const createStory = args => {
10
- const story = ({ label } = args) => html`
10
+ const story = ({ label, ariaLabel } = args) => html`
11
11
  <div style="width: 400px;">
12
- <edu-divider .label=${label}></edu-divider>
12
+ <edu-divider .label=${label} aria-label=${ariaLabel}></edu-divider>
13
13
  </div>
14
14
  `;
15
15
  story.parameters = {
@@ -22,6 +22,12 @@ const createStory = args => {
22
22
  description: 'Optional label text to display in the divider',
23
23
  name: 'label',
24
24
  },
25
+ ariaLabel: {
26
+ control: 'text',
27
+ description:
28
+ 'Accessible label for screen readers. If not provided, uses the label property or defaults to "Section divider"',
29
+ name: 'aria-label',
30
+ },
25
31
  };
26
32
  story.args = args;
27
33
  return story;
@@ -29,6 +35,7 @@ const createStory = args => {
29
35
 
30
36
  const defaultArgs = {
31
37
  label: '',
38
+ ariaLabel: '',
32
39
  };
33
40
 
34
41
  export const Default = createStory({ ...defaultArgs });
@@ -37,3 +44,9 @@ export const WithLabel = createStory({
37
44
  ...defaultArgs,
38
45
  label: 'Section Label',
39
46
  });
47
+
48
+ export const WithCustomAriaLabel = createStory({
49
+ ...defaultArgs,
50
+ label: 'OR',
51
+ ariaLabel: 'Alternative login separator',
52
+ });
@@ -4,11 +4,13 @@ import { colorsConstants } from '../../stylesConstants.js';
4
4
  export class EduDivider extends LitElement {
5
5
  static properties = {
6
6
  label: { type: String },
7
+ ariaLabel: { type: String, attribute: 'aria-label' },
7
8
  };
8
9
 
9
10
  constructor() {
10
11
  super();
11
12
  this.label = '';
13
+ this.ariaLabel = '';
12
14
  }
13
15
 
14
16
  static styles = [
@@ -37,11 +39,20 @@ export class EduDivider extends LitElement {
37
39
  ];
38
40
 
39
41
  render() {
42
+ const effectiveAriaLabel = this.ariaLabel || this.label;
43
+
40
44
  return html`
41
- <div class="divider" role="separator" aria-orientation="horizontal">
42
- <div class="line"></div>
43
- ${this.label ? html`<span class="label">${this.label}</span>` : null}
44
- <div class="line"></div>
45
+ <div
46
+ class="divider"
47
+ role="separator"
48
+ aria-orientation="horizontal"
49
+ aria-label=${effectiveAriaLabel || 'Section divider'}
50
+ >
51
+ <div class="line" aria-hidden="true"></div>
52
+ ${this.label
53
+ ? html`<span class="label" aria-hidden="true">${this.label}</span>`
54
+ : null}
55
+ <div class="line" aria-hidden="true"></div>
45
56
  </div>
46
57
  `;
47
58
  }
@@ -4,10 +4,21 @@ import './index.js';
4
4
  export default {
5
5
  title: 'Edu web components/EduLoadingSpinner',
6
6
  tags: ['autodocs'],
7
+ argTypes: {
8
+ label: {
9
+ control: 'text',
10
+ description: 'Accessible label for screen readers',
11
+ defaultValue: 'Loading',
12
+ },
13
+ },
7
14
  };
8
15
 
9
16
  const createStory = args => {
10
- const story = () => html` <edu-loading-spinner></edu-loading-spinner> `;
17
+ const story = () => html`
18
+ <edu-loading-spinner
19
+ label="${args.label || 'Loading'}"
20
+ ></edu-loading-spinner>
21
+ `;
11
22
  story.parameters = {
12
23
  controls: { expanded: true },
13
24
  docs: { source: { type: 'code' } },
@@ -17,6 +28,12 @@ const createStory = args => {
17
28
  return story;
18
29
  };
19
30
 
20
- const defaultArgs = {};
31
+ const defaultArgs = {
32
+ label: 'Loading',
33
+ };
21
34
 
22
35
  export const EduLoadingSpinnerDefault = createStory({ ...defaultArgs });
36
+
37
+ export const CustomLabel = createStory({
38
+ label: 'Please wait while we process your request',
39
+ });
@@ -2,9 +2,25 @@ import { html, css, LitElement } from 'lit';
2
2
  import { colorsConstants } from '../../stylesConstants.js';
3
3
 
4
4
  export class EduLoadingSpinner extends LitElement {
5
+ static properties = {
6
+ label: { type: String },
7
+ };
8
+
9
+ constructor() {
10
+ super();
11
+ this.label = 'Loading';
12
+ }
13
+
5
14
  static styles = [
6
15
  colorsConstants,
7
16
  css`
17
+ .spinner-container {
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ gap: 8px;
22
+ }
23
+
8
24
  .spinner {
9
25
  border: 8px solid var(--greyLight);
10
26
  border-top: 8px solid var(--primary);
@@ -14,6 +30,18 @@ export class EduLoadingSpinner extends LitElement {
14
30
  animation: spin 1.5s linear infinite;
15
31
  }
16
32
 
33
+ .visually-hidden {
34
+ position: absolute;
35
+ width: 1px;
36
+ height: 1px;
37
+ padding: 0;
38
+ margin: -1px;
39
+ overflow: hidden;
40
+ clip: rect(0, 0, 0, 0);
41
+ white-space: nowrap;
42
+ border-width: 0;
43
+ }
44
+
17
45
  @keyframes spin {
18
46
  0% {
19
47
  transform: rotate(0deg);
@@ -22,11 +50,22 @@ export class EduLoadingSpinner extends LitElement {
22
50
  transform: rotate(360deg);
23
51
  }
24
52
  }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ .spinner {
56
+ animation: spin 3s linear infinite;
57
+ }
58
+ }
25
59
  `,
26
60
  ];
27
61
 
28
62
  render() {
29
- return html` <div class="spinner"></div> `;
63
+ return html`
64
+ <div class="spinner-container" role="status" aria-live="polite">
65
+ <div class="spinner" aria-hidden="true"></div>
66
+ <span class="visually-hidden">${this.label}</span>
67
+ </div>
68
+ `;
30
69
  }
31
70
  }
32
71