@brightspace-ui/core 3.269.0 → 3.269.1

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.
@@ -1,6 +1,7 @@
1
1
  import '../colors/colors.js';
2
2
  import { css, html, LitElement } from 'lit';
3
3
  import { formatPercent } from '@brightspace-ui/intl';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
5
  import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
5
6
 
6
7
  export const DIVIDER_WIDTH = 4;
@@ -88,7 +89,10 @@ class PageDivider extends PropertyRequiredMixin(LitElement) {
88
89
  }
89
90
 
90
91
  render() {
91
- const currentSizePercent = formatPercent(Math.round(this.currentSize / this.maxSize) || 0);
92
+ let ariaValues = {};
93
+ if (this.maxSize > 0) {
94
+ ariaValues = { max: this.maxSize, min: 0, now: this.currentSize, text: formatPercent(this.currentSize / this.maxSize, { maximumFractionDigits: 0 }) };
95
+ }
92
96
 
93
97
  return html`
94
98
  <div
@@ -97,10 +101,10 @@ class PageDivider extends PropertyRequiredMixin(LitElement) {
97
101
  tabindex="0"
98
102
  aria-label="${this.label}"
99
103
  aria-orientation="${this.panelType === 'panel' ? 'horizontal' : 'vertical'}"
100
- aria-valuemax="${this.maxSize}"
101
- aria-valuemin="0"
102
- aria-valuenow="${this.currentSize}"
103
- aria-valuetext="${currentSizePercent}"
104
+ aria-valuemax="${ifDefined(ariaValues.max)}"
105
+ aria-valuemin="${ifDefined(ariaValues.min)}"
106
+ aria-valuenow="${ifDefined(ariaValues.now)}"
107
+ aria-valuetext="${ifDefined(ariaValues.text)}"
104
108
  @keydown="${this.#handleKeyDown}">
105
109
  </div>
106
110
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.269.0",
3
+ "version": "3.269.1",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",