@nectary/components 4.6.1 → 4.6.3

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.
@@ -88,9 +88,9 @@ defineCustomElement('sinch-action-menu', class extends NectaryElement {
88
88
  case 'Enter':
89
89
  case 'Space':
90
90
  {
91
- e.preventDefault();
92
91
  const $opt = this.#findSelectedOption();
93
92
  if ($opt !== null) {
93
+ e.preventDefault();
94
94
  $opt.click();
95
95
  }
96
96
  break;
package/button/index.js CHANGED
@@ -23,7 +23,7 @@ defineCustomElement('sinch-button', class extends NectaryElement {
23
23
  const {
24
24
  signal
25
25
  } = this.#controller;
26
- this.role = 'button';
26
+ this.setAttribute('role', 'button');
27
27
  this.tabIndex = 0;
28
28
  this.addEventListener('click', this.#onButtonClick, {
29
29
  signal
@@ -44,6 +44,6 @@ defineCustomElement('sinch-button-group', class extends NectaryElement {
44
44
  return getLiteralAttribute(this, sizeExValues, 'size', DEFAULT_SIZE);
45
45
  }
46
46
  connectedCallback() {
47
- this.role = 'group';
47
+ this.setAttribute('role', 'group');
48
48
  }
49
49
  });
@@ -23,7 +23,7 @@ defineCustomElement('sinch-button-group-item', class extends NectaryElement {
23
23
  const {
24
24
  signal
25
25
  } = this.#controller;
26
- this.role = 'button';
26
+ this.setAttribute('role', 'button');
27
27
  const forwardEvent = e => this.dispatchEvent(new CustomEvent(e.type, {
28
28
  ...e
29
29
  }));
package/checkbox/index.js CHANGED
@@ -19,7 +19,7 @@ defineCustomElement('sinch-checkbox', class extends NectaryElement {
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'checkbox';
22
+ this.setAttribute('role', 'checkbox');
23
23
  this.tabIndex = 0;
24
24
  this.addEventListener('click', this.#onClick, options);
25
25
  this.addEventListener('focus', this.#onFocus, options);
package/chip/index.js CHANGED
@@ -22,7 +22,7 @@ defineCustomElement('sinch-chip', class extends NectaryElement {
22
22
  const {
23
23
  signal
24
24
  } = this.#controller;
25
- this.role = 'button';
25
+ this.setAttribute('role', 'button');
26
26
  this.tabIndex = 0;
27
27
  this.addEventListener('click', this.#onClick, {
28
28
  signal
@@ -25,7 +25,7 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
25
25
  const options = {
26
26
  signal
27
27
  };
28
- this.role = 'listbox';
28
+ this.setAttribute('role', 'listbox');
29
29
  this.tabIndex = 0;
30
30
  this.addEventListener('keydown', this.#onListboxKeyDown, options);
31
31
  this.addEventListener('blur', this.#onListboxBlur, options);
@@ -151,9 +151,9 @@ defineCustomElement('sinch-color-menu', class extends NectaryElement {
151
151
  case 'Space':
152
152
  case 'Enter':
153
153
  {
154
- e.preventDefault();
155
154
  const $option = this.#findSelectedOption();
156
155
  if ($option !== null) {
156
+ e.preventDefault();
157
157
  this.#dispatchChangeEvent($option);
158
158
  }
159
159
  break;
@@ -18,7 +18,7 @@ defineCustomElement('sinch-color-menu-option', class extends NectaryElement {
18
18
  this.#$swatch = shadowRoot.querySelector('#swatch');
19
19
  }
20
20
  connectedCallback() {
21
- this.role = 'option';
21
+ this.setAttribute('role', 'option');
22
22
  }
23
23
  disconnectedCallback() {}
24
24
  static get observedAttributes() {
package/dialog/index.js CHANGED
@@ -29,7 +29,7 @@ defineCustomElement('sinch-dialog', class extends NectaryElement {
29
29
  const options = {
30
30
  signal: this.#controller.signal
31
31
  };
32
- this.role = 'dialog';
32
+ this.setAttribute('role', 'dialog');
33
33
  this.#$closeButton.addEventListener('click', this.#onCloseClick, options);
34
34
  this.#$dialog.addEventListener('mousedown', this.#onBackdropMouseDown, options);
35
35
  this.#$dialog.addEventListener('cancel', this.#onCancel, options);
package/input/index.js CHANGED
@@ -42,7 +42,7 @@ defineCustomElement('sinch-input', class extends NectaryElement {
42
42
  }
43
43
  connectedCallback() {
44
44
  super.connectedCallback();
45
- this.role = 'textbox';
45
+ this.setAttribute('role', 'textbox');
46
46
  if (this.#controller === null) {
47
47
  this.#controller = new AbortController();
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nectary/components",
3
- "version": "4.6.1",
3
+ "version": "4.6.3",
4
4
  "files": [
5
5
  "**/*/*.css",
6
6
  "**/*/*.json",
@@ -52,7 +52,7 @@ defineCustomElement('sinch-persistent-overlay', class extends NectaryElement {
52
52
  }
53
53
  connectedCallback() {
54
54
  super.connectedCallback();
55
- this.role = 'dialog';
55
+ this.setAttribute('role', 'dialog');
56
56
  this.#controller = new AbortController();
57
57
  const {
58
58
  signal
package/pop/index.js CHANGED
@@ -45,7 +45,7 @@ defineCustomElement('sinch-pop', class extends NectaryElement {
45
45
  } = this.#controller;
46
46
  this.#keydownContext.listen(signal);
47
47
  this.#visibilityContext.listen(signal);
48
- this.role = 'dialog';
48
+ this.setAttribute('role', 'dialog');
49
49
  this.#$dialog.addEventListener('cancel', this.#onCancel, {
50
50
  signal
51
51
  });
@@ -23,7 +23,7 @@ defineCustomElement('sinch-progress-stepper', class extends NectaryElement {
23
23
  const options = {
24
24
  signal
25
25
  };
26
- this.role = 'tablist';
26
+ this.setAttribute('role', 'tablist');
27
27
  this.#$slot.addEventListener('click', this.#onOptionClick, options);
28
28
  this.#$slot.addEventListener('keydown', this.#onOptionKeydown, options);
29
29
  this.#$slot.addEventListener('focusout', this.#onOptionBlur, options);
@@ -16,7 +16,7 @@ defineCustomElement('sinch-progress-stepper-item', class extends NectaryElement
16
16
  this.#$text = shadowRoot.querySelector('#text');
17
17
  }
18
18
  connectedCallback() {
19
- this.role = 'tab';
19
+ this.setAttribute('role', 'tab');
20
20
  }
21
21
  disconnectedCallback() {}
22
22
  static get observedAttributes() {
package/radio/index.js CHANGED
@@ -19,7 +19,7 @@ defineCustomElement('sinch-radio', class extends NectaryElement {
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'radiogroup';
22
+ this.setAttribute('role', 'radiogroup');
23
23
  this.#$slot.addEventListener('slotchange', this.#onSlotChange, options);
24
24
  this.#$slot.addEventListener('keydown', this.#onOptionKeyDown, options);
25
25
  this.#$slot.addEventListener('click', this.#onOptionClick, options);
@@ -11,7 +11,7 @@ defineCustomElement('sinch-radio-option', class extends NectaryElement {
11
11
  this.#$label = shadowRoot.querySelector('#label');
12
12
  }
13
13
  connectedCallback() {
14
- this.role = 'radio';
14
+ this.setAttribute('role', 'radio');
15
15
  this.tabIndex = 0;
16
16
  }
17
17
  disconnectedCallback() {}
@@ -30,7 +30,7 @@ defineCustomElement('sinch-rich-text', class extends NectaryElement {
30
30
  }
31
31
  connectedCallback() {
32
32
  super.connectedCallback();
33
- this.role = 'paragraph';
33
+ this.setAttribute('role', 'paragraph');
34
34
  this.#parseVisitor.updateEmojiBaseUrl(getEmojiBaseUrl(this));
35
35
  this.#updateText();
36
36
  }
@@ -58,7 +58,7 @@ defineCustomElement('sinch-rich-textarea', class extends NectaryElement {
58
58
  const options = {
59
59
  signal: this.#controller.signal
60
60
  };
61
- this.role = 'textbox';
61
+ this.setAttribute('role', 'textbox');
62
62
  this.ariaMultiLine = 'true';
63
63
  this.#$input.addEventListener('beforeinput', this.#onBeforeInput, options);
64
64
  this.#$input.addEventListener('keydown', this.#onKeydown, options);
@@ -19,7 +19,7 @@ defineCustomElement('sinch-segmented-control', class extends NectaryElement {
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'tablist';
22
+ this.setAttribute('role', 'tablist');
23
23
  this.#$slot.addEventListener('slotchange', this.#onSlotChange, options);
24
24
  this.#$slot.addEventListener('click', this.#onOptionClick, options);
25
25
  this.#$slot.addEventListener('keydown', this.#onOptionKeydown, options);
@@ -19,7 +19,7 @@ defineCustomElement('sinch-segmented-control-option', class extends NectaryEleme
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'tab';
22
+ this.setAttribute('role', 'tab');
23
23
  this.addEventListener('focus', this.#onButtonFocus, options);
24
24
  this.addEventListener('blur', this.#onButtonBlur, options);
25
25
  this.addEventListener('-focus', this.#onFocusReactHandler);
@@ -19,7 +19,7 @@ defineCustomElement('sinch-segmented-icon-control', class extends NectaryElement
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'tablist';
22
+ this.setAttribute('role', 'tablist');
23
23
  this.#$slot.addEventListener('slotchange', this.#onSlotChange, options);
24
24
  this.#$slot.addEventListener('click', this.#onOptionClick, options);
25
25
  this.#$slot.addEventListener('keydown', this.#onOptionKeydown, options);
@@ -17,7 +17,7 @@ defineCustomElement('sinch-segmented-icon-control-option', class extends Nectary
17
17
  const options = {
18
18
  signal
19
19
  };
20
- this.role = 'tab';
20
+ this.setAttribute('role', 'tab');
21
21
  this.addEventListener('focus', this.#onButtonFocus, options);
22
22
  this.addEventListener('blur', this.#onButtonBlur, options);
23
23
  this.addEventListener('-focus', this.#onFocusReactHandler, options);
@@ -30,7 +30,7 @@ defineCustomElement('sinch-select-button', class extends NectaryElement {
30
30
  const {
31
31
  signal
32
32
  } = this.#controller;
33
- this.role = 'button';
33
+ this.setAttribute('role', 'button');
34
34
  this.tabIndex = 0;
35
35
  this.addEventListener('click', this.#onButtonClick, {
36
36
  signal
@@ -33,7 +33,7 @@ defineCustomElement('sinch-select-menu', class extends NectaryElement {
33
33
  const options = {
34
34
  signal: this.#controller.signal
35
35
  };
36
- this.role = 'listbox';
36
+ this.setAttribute('role', 'listbox');
37
37
  this.tabIndex = 0;
38
38
  this.addEventListener('keydown', this.#onListboxKeyDown, options);
39
39
  this.addEventListener('focus', this.#onFocus, options);
@@ -215,9 +215,9 @@ defineCustomElement('sinch-select-menu', class extends NectaryElement {
215
215
  case 'Space':
216
216
  case 'Enter':
217
217
  {
218
- e.preventDefault();
219
218
  const $option = this.#findSelectedOption();
220
219
  if ($option !== null) {
220
+ e.preventDefault();
221
221
  this.#dispatchChangeEvent($option);
222
222
  }
223
223
  break;
@@ -15,7 +15,7 @@ defineCustomElement('sinch-tabs-icon-option', class extends NectaryElement {
15
15
  this.#$tooltip = shadowRoot.querySelector('#tooltip');
16
16
  }
17
17
  connectedCallback() {
18
- this.role = 'tab';
18
+ this.setAttribute('role', 'tab');
19
19
  this.#$button.addEventListener('click', this.#onClick);
20
20
  }
21
21
  disconnectedCallback() {
@@ -16,7 +16,7 @@ defineCustomElement('sinch-tabs-option', class extends NectaryElement {
16
16
  this.#$text = shadowRoot.querySelector('#text');
17
17
  }
18
18
  connectedCallback() {
19
- this.role = 'tab';
19
+ this.setAttribute('role', 'tab');
20
20
  this.#$button.addEventListener('click', this.#onClick);
21
21
  }
22
22
  disconnectedCallback() {
package/textarea/index.js CHANGED
@@ -33,7 +33,7 @@ defineCustomElement('sinch-textarea', class extends NectaryElement {
33
33
  const options = {
34
34
  signal: this.#controller.signal
35
35
  };
36
- this.role = 'textbox';
36
+ this.setAttribute('role', 'textbox');
37
37
  this.ariaMultiLine = 'true';
38
38
  this.#$input.addEventListener('input', this.#onInput, options);
39
39
  this.#$input.addEventListener('compositionstart', this.#onCompositionStart, options);
package/toggle/index.js CHANGED
@@ -19,7 +19,7 @@ defineCustomElement('sinch-toggle', class extends NectaryElement {
19
19
  const options = {
20
20
  signal
21
21
  };
22
- this.role = 'checkbox';
22
+ this.setAttribute('role', 'checkbox');
23
23
  this.addEventListener('click', this.#onClick, options);
24
24
  this.addEventListener('keydown', this.#onKeydown, options);
25
25
  this.addEventListener('focus', this.#onFocus, options);
package/tooltip/index.js CHANGED
@@ -50,6 +50,7 @@ defineCustomElement('sinch-tooltip', class extends NectaryElement {
50
50
  const options = {
51
51
  signal: this.#controller.signal
52
52
  };
53
+ this.setAttribute('role', 'tooltip');
53
54
  this.#$pop.addEventListener('-close', this.#onPopClose, options);
54
55
  this.addEventListener('-show', this.#onShowReactHandler, options);
55
56
  this.addEventListener('-hide', this.#onHideReactHandler, options);