gd-bs 6.2.5 → 6.2.7

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.
@@ -93,6 +93,9 @@ var _Button = /** @class */ (function (_super) {
93
93
  this.props.isSmall ? this.el.classList.add("btn-sm") : null;
94
94
  // Set the default type
95
95
  this.setType(this.props.type || ButtonTypes.Primary);
96
+ // Set the aria label/description
97
+ this.props.description ? this.el.setAttribute("aria-description", this.props.description) : null;
98
+ this.el.setAttribute("aria-label", this.props.label || this.props.text);
96
99
  // Set the attributes
97
100
  this.props.dismiss ? this.el.setAttribute("data-bs-dismiss", this.props.dismiss) : null;
98
101
  this.props.href ? this.el.href = this.props.href : null;
@@ -144,6 +144,7 @@ var _Dropdown = /** @class */ (function (_super) {
144
144
  if (toggle) {
145
145
  toggle.classList.add(btnType);
146
146
  toggle.disabled = this.props.isReadonly ? true : false;
147
+ toggle.setAttribute("aria-label", this.props.label || "");
147
148
  }
148
149
  // See if we are rendering the menu only
149
150
  var menu = this.el.querySelector(".dropdown-menu");
@@ -497,6 +498,7 @@ var _Dropdown = /** @class */ (function (_super) {
497
498
  if (ddl) {
498
499
  // Set the inner html
499
500
  ddl.innerHTML = value;
501
+ ddl.setAttribute("aria-label", value);
500
502
  }
501
503
  };
502
504
  // Enables/Disables the dark theme
@@ -94,6 +94,11 @@ var _Tooltip = /** @class */ (function (_super) {
94
94
  // Default the toggle property for the button
95
95
  var btnProps = this.props.btnProps || {};
96
96
  btnProps.type = btnProps.type || button_1.ButtonTypes.OutlineSecondary;
97
+ // See if the content is text
98
+ if (typeof (this.props.content) === "string") {
99
+ // Set the label
100
+ btnProps.description = this.props.content;
101
+ }
97
102
  // Create the button
98
103
  this._btn = (0, button_1.Button)(btnProps);
99
104
  // Update the element
@@ -347,6 +352,11 @@ var _Tooltip = /** @class */ (function (_super) {
347
352
  _Tooltip.prototype.setContent = function (content) {
348
353
  // Set the tippy content
349
354
  this.tippy.setContent(content);
355
+ // See if the button exists
356
+ if (this._btn && typeof (content) === "string") {
357
+ // Update the content
358
+ this._btn.el.setAttribute("aria-description", content);
359
+ }
350
360
  };
351
361
  // Shows the tooltip
352
362
  _Tooltip.prototype.show = function () {
@@ -19,6 +19,8 @@ var generateIcon = function (svg, height, width, className) {
19
19
  icon.classList.add(classNames[i]);
20
20
  }
21
21
  }
22
+ // Make this icon invisible to the screen reader
23
+ icon.setAttribute("aria-hidden", "true");
22
24
  // Set the height/width
23
25
  icon.setAttribute("height", (height ? height : 32).toString());
24
26
  icon.setAttribute("width", (width ? width : 32).toString());