@scania/tegel 1.26.0 → 1.27.0-allow-numbers-and-zero-values-beta.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.
Files changed (182) hide show
  1. package/dist/cjs/index-ca8040ad.js +4 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/tds-banner.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-checkbox.cjs.entry.js +10 -3
  5. package/dist/cjs/tds-chip.cjs.entry.js +7 -2
  6. package/dist/cjs/tds-dropdown_2.cjs.entry.js +74 -45
  7. package/dist/cjs/tds-folder-tab.cjs.entry.js +21 -2
  8. package/dist/cjs/tds-folder-tabs.cjs.entry.js +4 -2
  9. package/dist/cjs/tds-icon.cjs.entry.js +1 -1
  10. package/dist/cjs/tds-inline-tab.cjs.entry.js +21 -2
  11. package/dist/cjs/tds-inline-tabs.cjs.entry.js +4 -2
  12. package/dist/cjs/tds-link.cjs.entry.js +17 -3
  13. package/dist/cjs/tds-message.cjs.entry.js +15 -3
  14. package/dist/cjs/tds-modal.cjs.entry.js +74 -2
  15. package/dist/cjs/tds-navigation-tab.cjs.entry.js +21 -2
  16. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +6 -4
  17. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  18. package/dist/cjs/tds-text-field.cjs.entry.js +13 -7
  19. package/dist/cjs/tds-textarea.cjs.entry.js +21 -9
  20. package/dist/cjs/tds-toast.cjs.entry.js +4 -4
  21. package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
  22. package/dist/cjs/tds-tooltip.cjs.entry.js +14 -4
  23. package/dist/cjs/tegel.cjs.js +1 -1
  24. package/dist/collection/components/banner/banner.css +1 -1
  25. package/dist/collection/components/banner/banner.js +1 -1
  26. package/dist/collection/components/checkbox/checkbox.js +44 -3
  27. package/dist/collection/components/chip/chip.js +24 -2
  28. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +2 -2
  29. package/dist/collection/components/dropdown/dropdown.js +89 -43
  30. package/dist/collection/components/icon/icon.js +1 -1
  31. package/dist/collection/components/icon/iconsArray.js +96 -1
  32. package/dist/collection/components/link/link.js +17 -3
  33. package/dist/collection/components/message/message.css +44 -26
  34. package/dist/collection/components/message/message.js +49 -2
  35. package/dist/collection/components/modal/modal.js +103 -3
  36. package/dist/collection/components/popover-core/tds-popover-core.css +596 -53
  37. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +21 -2
  38. package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +40 -2
  39. package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +21 -2
  40. package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +40 -2
  41. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +21 -2
  42. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +42 -4
  43. package/dist/collection/components/text-field/text-field.js +31 -8
  44. package/dist/collection/components/textarea/textarea.css +11 -6
  45. package/dist/collection/components/textarea/textarea.js +38 -8
  46. package/dist/collection/components/toast/toast.css +1 -1
  47. package/dist/collection/components/toast/toast.js +3 -3
  48. package/dist/collection/components/toggle/toggle.js +2 -2
  49. package/dist/collection/components/tooltip/tooltip.js +40 -4
  50. package/dist/collection/utils/axeHelpers.js +1 -1
  51. package/dist/components/{p-c65351ab.js → p-14ab9663.js} +12 -3
  52. package/dist/components/p-17338bcb.js +115 -0
  53. package/dist/components/{p-2a43e410.js → p-2d93a742.js} +5 -5
  54. package/dist/components/p-4487c541.js +65 -0
  55. package/dist/components/{p-29d19dc8.js → p-60ff84f2.js} +1 -1
  56. package/dist/components/{p-a64dc22e.js → p-797c8dce.js} +75 -45
  57. package/dist/components/{p-4c1e3344.js → p-83db8b35.js} +1 -1
  58. package/dist/components/{p-b1d21573.js → p-a1181b1f.js} +1 -1
  59. package/dist/components/p-e71e3b2e.js +2052 -0
  60. package/dist/components/tds-accordion-item.js +1 -1
  61. package/dist/components/tds-banner.js +2 -2
  62. package/dist/components/tds-checkbox.js +1 -1
  63. package/dist/components/tds-chip.js +9 -3
  64. package/dist/components/tds-datetime.js +1 -1
  65. package/dist/components/tds-dropdown-option.js +1 -1
  66. package/dist/components/tds-dropdown.js +1 -1
  67. package/dist/components/tds-folder-tab.js +21 -2
  68. package/dist/components/tds-folder-tabs.js +7 -3
  69. package/dist/components/tds-footer-group.js +1 -1
  70. package/dist/components/tds-header-cell.js +1 -1
  71. package/dist/components/tds-header-dropdown.js +3 -3
  72. package/dist/components/tds-header-hamburger.js +1 -1
  73. package/dist/components/tds-header-launcher-button.js +1 -1
  74. package/dist/components/tds-header-launcher.js +4 -4
  75. package/dist/components/tds-icon.js +1 -1
  76. package/dist/components/tds-inline-tab.js +21 -2
  77. package/dist/components/tds-inline-tabs.js +7 -3
  78. package/dist/components/tds-link.js +17 -3
  79. package/dist/components/tds-message.js +19 -5
  80. package/dist/components/tds-modal.js +78 -4
  81. package/dist/components/tds-navigation-tab.js +21 -2
  82. package/dist/components/tds-navigation-tabs.js +9 -5
  83. package/dist/components/tds-popover-canvas.js +1 -1
  84. package/dist/components/tds-popover-core.js +1 -1
  85. package/dist/components/tds-popover-menu.js +1 -1
  86. package/dist/components/tds-side-menu-close-button.js +1 -1
  87. package/dist/components/tds-side-menu-dropdown.js +1 -1
  88. package/dist/components/tds-slider.js +1 -1
  89. package/dist/components/tds-step.js +1 -1
  90. package/dist/components/tds-table-body-input-wrapper.js +1 -1
  91. package/dist/components/tds-table-body-row.js +1 -1
  92. package/dist/components/tds-table-footer.js +4 -4
  93. package/dist/components/tds-table-header-input-wrapper.js +1 -1
  94. package/dist/components/tds-table-header.js +1 -1
  95. package/dist/components/tds-table-toolbar.js +1 -1
  96. package/dist/components/tds-text-field.js +15 -8
  97. package/dist/components/tds-textarea.js +36 -11
  98. package/dist/components/tds-toast.js +5 -5
  99. package/dist/components/tds-toggle.js +2 -2
  100. package/dist/components/tds-tooltip.js +1 -102
  101. package/dist/esm/index-51d04e39.js +4 -4
  102. package/dist/esm/loader.js +1 -1
  103. package/dist/esm/tds-banner.entry.js +1 -1
  104. package/dist/esm/tds-checkbox.entry.js +10 -3
  105. package/dist/esm/tds-chip.entry.js +7 -2
  106. package/dist/esm/tds-dropdown_2.entry.js +74 -45
  107. package/dist/esm/tds-folder-tab.entry.js +22 -3
  108. package/dist/esm/tds-folder-tabs.entry.js +4 -2
  109. package/dist/esm/tds-icon.entry.js +1 -1
  110. package/dist/esm/tds-inline-tab.entry.js +22 -3
  111. package/dist/esm/tds-inline-tabs.entry.js +4 -2
  112. package/dist/esm/tds-link.entry.js +17 -3
  113. package/dist/esm/tds-message.entry.js +15 -3
  114. package/dist/esm/tds-modal.entry.js +74 -2
  115. package/dist/esm/tds-navigation-tab.entry.js +22 -3
  116. package/dist/esm/tds-navigation-tabs.entry.js +6 -4
  117. package/dist/esm/tds-popover-core.entry.js +1 -1
  118. package/dist/esm/tds-text-field.entry.js +13 -7
  119. package/dist/esm/tds-textarea.entry.js +21 -9
  120. package/dist/esm/tds-toast.entry.js +4 -4
  121. package/dist/esm/tds-toggle.entry.js +2 -2
  122. package/dist/esm/tds-tooltip.entry.js +14 -4
  123. package/dist/esm/tegel.js +1 -1
  124. package/dist/tegel/p-0f2c9507.entry.js +1 -0
  125. package/dist/tegel/p-125a6b06.entry.js +1 -0
  126. package/dist/tegel/p-28517288.entry.js +1 -0
  127. package/dist/tegel/p-2af57972.entry.js +1 -0
  128. package/dist/tegel/p-3e9ca19a.entry.js +1 -0
  129. package/dist/tegel/{p-be1d1345.entry.js → p-4465f687.entry.js} +1 -1
  130. package/dist/tegel/p-668b7662.entry.js +1 -0
  131. package/dist/tegel/{p-4e298888.entry.js → p-66f394a2.entry.js} +1 -1
  132. package/dist/tegel/p-754a4921.entry.js +1 -0
  133. package/dist/tegel/{p-46205cfb.entry.js → p-769d0503.entry.js} +1 -1
  134. package/dist/tegel/p-843413ba.entry.js +1 -0
  135. package/dist/tegel/p-97f10223.entry.js +1 -0
  136. package/dist/tegel/p-a21250b8.entry.js +1 -0
  137. package/dist/tegel/p-aadb2553.entry.js +1 -0
  138. package/dist/tegel/p-b08886e3.entry.js +1 -0
  139. package/dist/tegel/p-b114ec3d.entry.js +1 -0
  140. package/dist/tegel/p-c3607f10.entry.js +1 -0
  141. package/dist/tegel/p-ddda64eb.entry.js +1 -0
  142. package/dist/tegel/p-eaa279dd.entry.js +1 -0
  143. package/dist/tegel/p-ee960089.entry.js +1 -0
  144. package/dist/tegel/tegel.css +13 -3
  145. package/dist/tegel/tegel.esm.js +1 -1
  146. package/dist/types/components/checkbox/checkbox.d.ts +5 -0
  147. package/dist/types/components/chip/chip.d.ts +3 -0
  148. package/dist/types/components/dropdown/dropdown.d.ts +5 -0
  149. package/dist/types/components/message/message.d.ts +5 -0
  150. package/dist/types/components/modal/modal.d.ts +6 -0
  151. package/dist/types/components/tabs/folder-tabs/folder-tab/folder-tab.d.ts +2 -0
  152. package/dist/types/components/tabs/folder-tabs/folder-tabs.d.ts +4 -0
  153. package/dist/types/components/tabs/inline-tabs/inline-tab/inline-tab.d.ts +2 -0
  154. package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +4 -0
  155. package/dist/types/components/tabs/navigation-tabs/navigation-tab/navigation-tab.d.ts +2 -0
  156. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +4 -0
  157. package/dist/types/components/text-field/text-field.d.ts +4 -1
  158. package/dist/types/components/textarea/textarea.d.ts +7 -4
  159. package/dist/types/components/tooltip/tooltip.d.ts +3 -0
  160. package/dist/types/components.d.ts +130 -2
  161. package/dist/types/types/Icons.d.ts +1 -1
  162. package/dist/types/utils/axeHelpers.d.ts +1 -2
  163. package/package.json +1 -1
  164. package/dist/components/p-4764a1d5.js +0 -2052
  165. package/dist/components/p-a2b7bdef.js +0 -65
  166. package/dist/tegel/p-065d6f83.entry.js +0 -1
  167. package/dist/tegel/p-0c1e632d.entry.js +0 -1
  168. package/dist/tegel/p-168122a7.entry.js +0 -1
  169. package/dist/tegel/p-19eb4ae1.entry.js +0 -1
  170. package/dist/tegel/p-4e33cbda.entry.js +0 -1
  171. package/dist/tegel/p-4ee344e5.entry.js +0 -1
  172. package/dist/tegel/p-64c80f14.entry.js +0 -1
  173. package/dist/tegel/p-72fd0083.entry.js +0 -1
  174. package/dist/tegel/p-93a4bd11.entry.js +0 -1
  175. package/dist/tegel/p-9e0b31a1.entry.js +0 -1
  176. package/dist/tegel/p-a0fc0cc2.entry.js +0 -1
  177. package/dist/tegel/p-b35e7208.entry.js +0 -1
  178. package/dist/tegel/p-b6526302.entry.js +0 -1
  179. package/dist/tegel/p-b686f1ad.entry.js +0 -1
  180. package/dist/tegel/p-cca85da0.entry.js +0 -1
  181. package/dist/tegel/p-d0abf078.entry.js +0 -1
  182. package/dist/tegel/p-dcbc35af.entry.js +0 -1
@@ -15,14 +15,28 @@ const TdsLink = class {
15
15
  this.standalone = false;
16
16
  }
17
17
  connectedCallback() {
18
- this.host.children[0].classList.add('tds-link-component');
18
+ const links = this.host.querySelectorAll('a');
19
+ if (links.length > 1) {
20
+ console.warn('tds-link is only intended to wrap one <a> tag');
21
+ }
22
+ const link = links[0];
23
+ if (link) {
24
+ if (this.disabled) {
25
+ link.setAttribute('tabindex', '-1');
26
+ link.setAttribute('aria-disabled', 'true');
27
+ }
28
+ else {
29
+ link.removeAttribute('tabindex');
30
+ link.removeAttribute('aria-disabled');
31
+ }
32
+ }
19
33
  }
20
34
  render() {
21
- return (index.h("span", { key: '3fa509835f66a3128ee487b34b47c0efb9e73d82', class: {
35
+ return (index.h("span", { key: '1183de952c2fd6cb1193e9e0dec419f37bf07dee', class: {
22
36
  'disabled': this.disabled,
23
37
  'no-underline': !this.underline,
24
38
  'standalone': this.standalone,
25
- } }, index.h("slot", { key: 'd83160f7b9b04e0e0cd9bd9184a45ac8ac504744' })));
39
+ } }, index.h("slot", { key: 'e019a83d2335cd0a7d682e79a6bf0148452c3e71' })));
26
40
  }
27
41
  get host() { return index.getElement(this); }
28
42
  };
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-ca8040ad.js');
6
+ const generateUniqueId = require('./generateUniqueId-e3fc9863.js');
6
7
 
7
- const messageCss = ":host .wrapper{display:flex;padding:16px;background-color:var(--tds-message-background);border-radius:4px}:host .wrapper.information{border-left:4px solid var(--tds-information)}:host .wrapper.information tds-icon{color:var(--tds-information)}:host .wrapper.success{border-left:4px solid var(--tds-positive)}:host .wrapper.success tds-icon{color:var(--tds-positive)}:host .wrapper.error{background-color:var(--tds-message-type-error-background);border-left:4px solid var(--tds-negative)}:host .wrapper.error tds-icon{color:var(--tds-negative)}:host .wrapper.warning{border-left:4px solid var(--tds-warning)}:host .wrapper.warning tds-icon{color:var(--tds-warning)}:host .wrapper.minimal{border:none;display:flex;align-items:center;padding:0;background-color:transparent}:host .wrapper.minimal .header{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .wrapper.minimal.error .header{color:var(--tds-negative)}:host tds-icon{padding-right:16px}:host .content{display:flex;flex-direction:column;gap:4px;color:var(--tds-message-color);padding:2px 0}:host .content .header{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls)}:host .content .extended-message{color:var(--tds-message-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .tds-mode-variant-primary{--tds-message-background:var(--tds-message-background-primary)}:host .tds-mode-variant-secondary{--tds-message-background:var(--tds-message-background-secondary)}";
8
+ const messageCss = ":host{--tds-message-background:var(--background-elevation-layer-03);}:host .tds-mode-variant-primary{--tds-message-background:var(--background-elevation-layer-03)}:host .tds-mode-variant-secondary{--tds-message-background:var(--background-elevation-layer-02)}:host .wrapper{display:flex;padding:16px;background-color:var(--tds-message-background);border-radius:4px}:host .wrapper.information{border-left:4px solid var(--system-info-default)}:host .wrapper.information tds-icon{color:var(--system-info-default)}:host .wrapper.success{border-left:4px solid var(--system-success-default)}:host .wrapper.success tds-icon{color:var(--system-success-default)}:host .wrapper.error{background-color:var(--system-danger-subtle);border-left:4px solid var(--system-danger-default)}:host .wrapper.error tds-icon{color:var(--system-danger-default)}:host .wrapper.warning{border-left:4px solid var(--system-warning-default)}:host .wrapper.warning tds-icon{color:var(--system-warning-default)}:host .wrapper.minimal{border:none;padding:0;background-color:transparent}:host .wrapper.minimal .header{font-family:var(--detail-02-font-family);font-size:var(--detail-02-font-size);line-height:var(--detail-02-line-height);font-weight:var(--detail-02-font-weight);letter-spacing:var(--detail-02-letter-spacing);text-transform:var(--detail-02-text-transform)}:host .wrapper.minimal.error .header{color:var(--system-danger-default)}:host tds-icon{padding-right:16px}:host .content{display:flex;flex-direction:column;gap:4px;color:var(--foreground-text-strong);padding:2px 0}:host .content .header{font-family:var(--headline-07-font-family);font-size:var(--headline-07-font-size);line-height:var(--headline-07-line-height);font-weight:var(--headline-07-font-weight);letter-spacing:var(--headline-07-letter-spacing);text-transform:var(--headline-07-text-transform)}:host .content .extended-message{color:var(--foreground-text-strong);font-family:var(--detail-02-font-family);font-size:var(--detail-02-font-size);line-height:var(--detail-02-line-height);font-weight:var(--detail-02-font-weight);letter-spacing:var(--detail-02-letter-spacing);text-transform:var(--detail-02-text-transform)}";
8
9
  const TdsMessageStyle0 = messageCss;
9
10
 
10
11
  const TdsMessage = class {
@@ -29,14 +30,25 @@ const TdsMessage = class {
29
30
  this.variant = 'information';
30
31
  this.noIcon = false;
31
32
  this.minimal = false;
33
+ this.tdsAlertDialog = 'dialog';
34
+ this.tdsAriaLabel = undefined;
35
+ }
36
+ getAriaLabel() {
37
+ if (this.header) {
38
+ return undefined;
39
+ }
40
+ const variantLabel = `${this.variant} message`;
41
+ return this.tdsAriaLabel || variantLabel;
32
42
  }
33
43
  render() {
34
- return (index.h(index.Host, { key: 'efeee188e97e2562fa55dcd8217277cc69f80010' }, index.h("div", { key: '9d0f0fb52a4dfeb6912d141f8ee124d45c8ad382', class: {
44
+ const headerId = this.header ? `tds-message-header-${generateUniqueId.generateUniqueId()}` : undefined;
45
+ const contentId = !this.minimal ? `tds-message-content-${generateUniqueId.generateUniqueId()}` : undefined;
46
+ return (index.h(index.Host, { key: 'b28d7e5de5b3cb612e78f83650fa5c0621107dda', role: this.tdsAlertDialog, "aria-labelledby": headerId, "aria-describedby": contentId, "aria-label": this.getAriaLabel() }, index.h("div", { key: 'a3d7470a99af752df3516009d39f7e1c4bbed096', class: {
35
47
  wrapper: true,
36
48
  [this.variant]: true,
37
49
  minimal: this.minimal,
38
50
  [`tds-mode-variant-${this.modeVariant}`]: this.modeVariant !== null,
39
- } }, !this.noIcon && index.h("tds-icon", { key: 'd5fac1d2e80a7082520e5d8286f8cc3b158108fc', name: this.getIconName(), size: "20px" }), index.h("div", { key: 'e476f032fb5b14f219406f520690ce06b5677096', class: `content` }, this.header && index.h("div", { key: 'f9e23723c651c0c4ebf0a4da389779f87367739f', class: "header" }, this.header), !this.minimal && (index.h("div", { key: '3aa181cccd7fecbeea251245c54c53990956b271', class: "extended-message" }, index.h("slot", { key: 'ba233143933785b13fdeeee0f4154d4ce481dfe6' })))))));
51
+ } }, !this.noIcon && (index.h("tds-icon", { key: '5ce066cccec225e2707e660f73396f24197d024d', "aria-label": `${this.variant}`, svgTitle: `${this.variant}`, name: this.getIconName(), size: "20px" })), index.h("div", { key: 'ec0101d39dd0354b163219b732fd9dfa9cd66e60', class: `content` }, this.header && (index.h("div", { key: '434be3923b805cc8bd77d232a8cdbf847f9793c8', class: "header", id: headerId }, this.header)), !this.minimal && (index.h("div", { key: '14f5ead963e55d7e3bad6abc69e97ba9f994316f', class: "extended-message", id: contentId }, index.h("slot", { key: '37c61ef3a396e37a7cb130951d44af9454163699' })))))));
40
52
  }
41
53
  };
42
54
  TdsMessage.style = TdsMessageStyle0;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-ca8040ad.js');
6
6
  const hasSlot = require('./hasSlot-1c90e9ba.js');
7
+ const generateUniqueId = require('./generateUniqueId-e3fc9863.js');
7
8
 
8
9
  const modalCss = ".tds-modal{box-sizing:border-box;background-color:var(--tds-modal-background);margin:auto;position:relative;border-radius:4px;max-height:85vh;overflow-y:auto;pointer-events:auto;}.tds-modal *{box-sizing:border-box}.tds-modal::-webkit-scrollbar{width:5px;background-color:var(--tds-grey-300);border-radius:0 1em 1em 0}.tds-modal::-webkit-scrollbar-track{background-color:var(--tds-grey-300);border-radius:0 1em 1em 0}.tds-modal::-webkit-scrollbar-thumb{background-color:var(--tds-grey-500);border-radius:0 1em 1em 0}.tds-modal__actions-sticky{overflow:hidden;display:flex;flex-direction:column}.tds-modal__actions-sticky .body{font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls);max-height:calc(85vh - 36px);overflow-y:auto}.tds-modal__actions-sticky slot[name=actions]{bottom:-1px;left:0;right:0;background-color:var(--tds-modal-background);padding:var(--tds-spacing-element-24) var(--tds-spacing-element-16) var(--tds-spacing-element-16);display:flex;gap:16px}.tds-modal__actions-static slot[name=actions]{background-color:var(--tds-modal-background);display:flex;gap:16px;padding:24px 16px 16px}@media (min-width: 320px){.tds-modal-xs{width:100%}.tds-modal-sm{width:100%}.tds-modal-md{width:100%}.tds-modal-lg{width:100%}}@media (min-width: 672px){.tds-modal-xs{width:50%}.tds-modal-sm{width:62.5%}.tds-modal-md{width:75%}.tds-modal-lg{width:100%}}@media (min-width: 1056px){.tds-modal-xs{width:31.25%}.tds-modal-sm{width:43.75%}.tds-modal-md{width:62.5%}.tds-modal-lg{width:75%}}@media (min-width: 1312px){.tds-modal-xs{width:31.25%}.tds-modal-sm{width:37.5%}.tds-modal-md{width:62.5%}.tds-modal-lg{width:75%}}@media (min-width: 1584px){.tds-modal-xs{width:25%}.tds-modal-sm{width:37.5%}.tds-modal-md{width:50%}.tds-modal-lg{width:75%}}@media (max-width: 320px){.tds-modal-md,.tds-modal-lg,.tds-modal-sm{height:100%}.tds-modal-md slot[name=actions]::slotted(*),.tds-modal-lg slot[name=actions]::slotted(*),.tds-modal-sm slot[name=actions]::slotted(*){display:flex}}.header{display:flex;padding:var(--tds-spacing-element-16);position:sticky;top:0;background-color:var(--tds-modal-background);z-index:1}.header,slot[name=header]::slotted(*){color:var(--tds-modal-text);font:var(--tds-headline-05) !important;letter-spacing:var(--tds-headline-05-ls) !important;margin:0;flex:1}.body{color:var(--tds-modal-text);font:var(--tds-body-01);letter-spacing:var(--tds-body-01-ls);overflow-y:visible;padding:0 var(--tds-spacing-element-16) var(--tds-spacing-element-16);}.body::-webkit-scrollbar{width:5px;background-color:var(--tds-grey-300)}.body::-webkit-scrollbar-track{background-color:var(--tds-grey-300)}.body::-webkit-scrollbar-thumb{background-color:var(--tds-grey-500)}.tds-modal-backdrop{box-sizing:border-box;position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--tds-modal-backdrop);pointer-events:auto}.tds-modal-backdrop *{box-sizing:border-box}button.tds-modal-close{margin:0 0 auto auto;background-color:transparent;border:0;padding:0;appearance:unset}.tds-modal-close{display:inline-block;height:auto;color:var(--tds-modal-icon);cursor:pointer}.tds-modal-close:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}@media (min-width: 320px){.tds-modal-close{margin-left:var(--tds-spacing-element-16)}}@media (min-width: 1056px){.tds-modal-close{margin-left:var(--tds-spacing-element-48)}}.tds-modal-close-btn{display:inline-block;height:auto;background-repeat:no-repeat;cursor:pointer}@media (min-width: 320px){.tds-modal-close-btn{margin-left:var(--tds-spacing-element-16)}}@media (min-width: 1056px){.tds-modal-close-btn{margin-left:var(--tds-spacing-element-48)}}.tds-modal-close-btn svg{fill:var(--tds-modal-icon)}.tds-modal-overflow{overflow:hidden}:host{box-sizing:border-box;position:fixed;top:0;right:0;bottom:0;left:0;padding:0 16px;z-index:700;pointer-events:none}:host *{box-sizing:border-box}:host .tds-modal-close{border:none;background-color:transparent}:host .tds-modal-close-btn{border:none;background-color:transparent}@media (max-width: 320px){:host{padding:0}}:host.show{display:flex}:host.hide{display:none}:host(.show){display:flex}:host(.hide){display:none}";
9
10
  const TdsModalStyle0 = modalCss;
@@ -14,6 +15,7 @@ const TdsModal = class {
14
15
  this.tdsClose = index.createEvent(this, "tdsClose", 7);
15
16
  this.handleClose = (event) => {
16
17
  const closeEvent = this.tdsClose.emit(event);
18
+ this.returnFocusOnClose();
17
19
  if (!closeEvent.defaultPrevented) {
18
20
  this.isShown = false;
19
21
  }
@@ -62,15 +64,26 @@ const TdsModal = class {
62
64
  this.referenceEl = undefined;
63
65
  this.show = undefined;
64
66
  this.closable = true;
67
+ this.tdsAlertDialog = 'dialog';
65
68
  this.isShown = false;
69
+ this.activeElementIndex = 0;
66
70
  }
67
71
  /** Shows the Modal. */
68
72
  async showModal() {
69
73
  this.isShown = true;
74
+ // Set focus on first element when opened
75
+ requestAnimationFrame(() => {
76
+ const focusableElements = this.getFocusableElements();
77
+ if (focusableElements.length > 0) {
78
+ focusableElements[0].focus();
79
+ this.activeElementIndex = 0;
80
+ }
81
+ });
70
82
  }
71
83
  /** Closes the Modal. */
72
84
  async closeModal() {
73
85
  this.isShown = false;
86
+ this.returnFocusOnClose();
74
87
  }
75
88
  connectedCallback() {
76
89
  if (this.closable === undefined) {
@@ -108,6 +121,63 @@ const TdsModal = class {
108
121
  dismissButton.removeEventListener('click', this.handleClose);
109
122
  });
110
123
  }
124
+ returnFocusOnClose() {
125
+ var _a;
126
+ let referenceEl = (_a = this.referenceEl) !== null && _a !== void 0 ? _a : document.querySelector(this.selector);
127
+ const potentialReferenceElements = ['BUTTON', 'A', 'INPUT'];
128
+ // If referenced element is a custom element eg: tds-button we find the interactive element inside
129
+ if (potentialReferenceElements.indexOf(referenceEl.tagName) < 0) {
130
+ referenceEl = referenceEl.querySelectorAll(potentialReferenceElements.join(','))[0];
131
+ }
132
+ referenceEl.focus();
133
+ }
134
+ getFocusableElements() {
135
+ const focusableSelectors = [
136
+ 'a[href]',
137
+ 'button:not([disabled])',
138
+ 'textarea:not([disabled])',
139
+ 'input:not([disabled])',
140
+ 'select:not([disabled])',
141
+ '[tabindex]:not([tabindex="-1"])',
142
+ ].join(',');
143
+ const focusableInShadowRoot = Array.from(this.host.shadowRoot.querySelectorAll(focusableSelectors));
144
+ const focusableInSlots = Array.from(this.host.querySelectorAll(focusableSelectors));
145
+ /** Focusable elements */
146
+ return [...focusableInShadowRoot, ...focusableInSlots];
147
+ }
148
+ handleFocusTrap(event) {
149
+ if (event.key === 'Escape' && this.isShown && !this.prevent) {
150
+ this.handleClose(event);
151
+ return;
152
+ }
153
+ // Only trap focus if the modal is open
154
+ if (!this.isShown)
155
+ return;
156
+ // We care only about the Tab key
157
+ if (event.key !== 'Tab')
158
+ return;
159
+ const focusableElements = this.getFocusableElements();
160
+ // If there are no focusable elements
161
+ if (focusableElements.length === 0)
162
+ return;
163
+ event.preventDefault();
164
+ // Going backwards (Shift + Tab) on the first element => move to last
165
+ if (event.shiftKey) {
166
+ this.activeElementIndex -= 1;
167
+ if (this.activeElementIndex === -1) {
168
+ this.activeElementIndex = focusableElements.length - 1;
169
+ }
170
+ }
171
+ // // Going forwards (Tab) on the last element => move to first
172
+ if (!event.shiftKey) {
173
+ this.activeElementIndex += 1;
174
+ if (this.activeElementIndex === focusableElements.length) {
175
+ this.activeElementIndex = 0;
176
+ }
177
+ }
178
+ const nextElement = focusableElements[this.activeElementIndex];
179
+ nextElement.focus();
180
+ }
111
181
  /** Adds an event listener to the dismiss buttons that closes the Modal. */
112
182
  setDismissButtons() {
113
183
  this.host.querySelectorAll('[data-dismiss-modal]').forEach((dismissButton) => {
@@ -117,10 +187,12 @@ const TdsModal = class {
117
187
  render() {
118
188
  const usesHeaderSlot = hasSlot.hasSlot('header', this.host);
119
189
  const usesActionsSlot = hasSlot.hasSlot('actions', this.host);
120
- return (index.h(index.Host, { key: '3b815395be0ccab91eebda3ca785528de624d17e', class: {
190
+ const headerId = this.header ? `tds-modal-header-${generateUniqueId.generateUniqueId()}` : undefined;
191
+ const bodyId = `tds-modal-body-${generateUniqueId.generateUniqueId()}`;
192
+ return (index.h(index.Host, { key: '398809ea45126dd70b95422f2f7a08a481a22d53', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
121
193
  show: this.isShown,
122
194
  hide: !this.isShown,
123
- }, onClick: (event) => this.handleOverlayClick(event) }, index.h("div", { key: '84c9952f862e5defe06c04040e7031e08c5caca3', class: "tds-modal-backdrop" }), index.h("div", { key: '42b3ea985203a582b3a3dee5250b4a4468a23d6f', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, index.h("div", { key: '06e005618aeab759c01f7d556cc4357f0aed0e1d', class: "header" }, this.header && index.h("div", { key: 'bff8080a479c4ecef96eae35dc0f33cc3fadaa8c', class: "header-text" }, this.header), usesHeaderSlot && index.h("slot", { key: 'dbec4b999fcda87c5c751a8cf3eb7b9f66e1ec43', name: "header" }), this.closable && (index.h("button", { key: 'bfbfe0d3419aa5e2a5fcbab7691560ed5619dd05', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, index.h("tds-icon", { key: '3bcd38d4234a689acd63bb82e21b270c2b0825f9', name: "cross", size: "20px" })))), index.h("div", { key: '2fc5756d3261dfa354ce3025dc9d8ff213c49ba1', class: "body" }, index.h("slot", { key: '389ac6e307873c9de7c36c0960ce578cdfaf88e4', name: "body" })), usesActionsSlot && index.h("slot", { key: 'c964f9d3999f26995543187c553adcc9ac392f2a', name: "actions" }))));
195
+ }, onClick: (event) => this.handleOverlayClick(event) }, index.h("div", { key: '96e964cc4f3c6d9613fb53e340e0aa5dcd8b6d81', class: "tds-modal-backdrop" }), index.h("div", { key: 'af7ddc896ef35b6116ae70524d10c4b7b952e20a', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, index.h("div", { key: '9dfcf95fcc8925cd5c97f10f29edc6cef183a0ca', id: headerId, class: "header" }, this.header && index.h("div", { key: '42533c25b07e696a0c61504556150018f8d3583a', class: "header-text" }, this.header), usesHeaderSlot && index.h("slot", { key: 'd9855a20e1763ad17d6c8b80df85796d8f6027a8', name: "header" }), this.closable && (index.h("button", { key: '3e99b76da7bcf39eaecbe2906e0674fd20ebe9a6', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, index.h("tds-icon", { key: 'f6463437fb98ae280afe358d50a2f960914014ea', name: "cross", size: "20px" })))), index.h("div", { key: 'ba8ca2e65f5eac8103e6f3c431e3ae9aab2b5f72', id: bodyId, class: "body" }, index.h("slot", { key: '9e08cbdd00e1a60826588b15cb6ed23fc4b5b0d7', name: "body" })), usesActionsSlot && index.h("slot", { key: 'aeb50dfcbf6c12e80a8904d149bb15892c691d88', name: "actions" }))));
124
196
  }
125
197
  get host() { return index.getElement(this); }
126
198
  };
@@ -17,10 +17,29 @@ const TdsNavigationTab = class {
17
17
  async setSelected(selected) {
18
18
  this.selected = selected;
19
19
  }
20
+ connectedCallback() {
21
+ const elements = this.host.querySelectorAll('button, a');
22
+ for (let index = 0; index < elements.length; index++) {
23
+ const element = elements[index];
24
+ if (!element.getAttribute('aria-controls')) {
25
+ console.warn('Tegel navigation-tab component: Interactive elements should have aria-controls attribute to link the tab to its corresponding panel');
26
+ }
27
+ if (element.getAttribute('role') !== 'tab') {
28
+ console.warn('Tegel navigation-tab component: Interactive elements should have attribute role="tab"');
29
+ }
30
+ if (this.disabled) {
31
+ element.setAttribute('aria-disabled', 'true');
32
+ }
33
+ else {
34
+ element.removeAttribute('aria-disabled');
35
+ }
36
+ }
37
+ }
20
38
  render() {
21
- return (index.h(index.Host, { key: '58749f71c75a0026b58645df3ccaa6ebd5e5dc9f', role: "listitem" }, index.h("div", { key: 'ed4cc04c74a69470c95f9ec3ba034c7ad6b9f2d3', class: `navigation-tab-item ${this.selected ? 'selected' : ''}
22
- ${this.disabled ? 'disabled' : ''}` }, index.h("slot", { key: 'ee7c740413087d0da51bdfc8da4509d482f1faeb' }))));
39
+ return (index.h(index.Host, { key: '51152bf313a84cb937e7f49e87cc8dcd74ab0612' }, index.h("div", { key: '5d55db68f75e042dafe40da1b9e84d74f1cd8849', class: `navigation-tab-item ${this.selected ? 'selected' : ''}
40
+ ${this.disabled ? 'disabled' : ''}` }, index.h("slot", { key: '174108daa16d6fa68c04244af1843771a4df91f5' }))));
23
41
  }
42
+ get host() { return index.getElement(this); }
24
43
  };
25
44
  TdsNavigationTab.style = TdsNavigationTabStyle0;
26
45
 
@@ -68,6 +68,8 @@ const TdsNavigationTabs = class {
68
68
  this.defaultSelectedIndex = 0;
69
69
  this.selectedIndex = undefined;
70
70
  this.leftPadding = 32;
71
+ this.tdsScrollLeftAriaLabel = 'Scroll left';
72
+ this.tdsScrollRightAriaLabel = 'Scroll right';
71
73
  this.showLeftScroll = false;
72
74
  this.showRightScroll = false;
73
75
  }
@@ -174,15 +176,15 @@ const TdsNavigationTabs = class {
174
176
  this.removeEventListenerFromTabs();
175
177
  }
176
178
  render() {
177
- return (index.h(index.Host, { key: '0ca3544da4ef897b44bd2f55b0dc03edf7921818', role: "list", class: { [`tds-mode-variant-${this.modeVariant}`]: this.modeVariant !== null } }, index.h("div", { key: '3eff9e0fc6b416171d0928e3e1933fed626fb3ec', class: "wrapper", ref: (el) => {
179
+ return (index.h(index.Host, { key: '809fe9d34b03949edae1708b6dea7f0406afee80', role: "tablist", class: { [`tds-mode-variant-${this.modeVariant}`]: this.modeVariant !== null } }, index.h("div", { key: '866605f8695441d7817c07895bdffd5e3e7ba5ac', class: "wrapper", ref: (el) => {
178
180
  this.navWrapperElement = el;
179
- }, style: { paddingLeft: `${this.leftPadding}px` } }, index.h("button", { key: '730023259356eec4ec037e56a495dfea4f8d469c', class: {
181
+ }, style: { paddingLeft: `${this.leftPadding}px` } }, index.h("button", { key: '2d394ecb940cee024174932676c2a6c22622c853', "aria-label": this.tdsScrollLeftAriaLabel, class: {
180
182
  'scroll-left-button': true,
181
183
  'show': this.showLeftScroll,
182
- }, onClick: () => this.scrollLeft(), disabled: !this.showLeftScroll }, index.h("tds-icon", { key: '5e601f5e4a3aa308e5a5a636fc08c7b32387dbd9', name: "chevron_left", size: "20px" })), index.h("slot", { key: '43c9228e6c328b4cc651a9ffbd7dd8dbbfd592fe', onSlotchange: () => this.handleSlotChange() }), index.h("button", { key: '7eca0796fed3a98043abbbe306c29eed10cd8c5d', class: {
184
+ }, onClick: () => this.scrollLeft(), disabled: !this.showLeftScroll }, index.h("tds-icon", { key: '09386162127467a545e00f44130352afb9cfed03', name: "chevron_left", size: "20px" })), index.h("slot", { key: '3b3cd70ed645318d0661a3acbee3d2bc748314cf', onSlotchange: () => this.handleSlotChange() }), index.h("button", { key: '1afb2dc9b261626db800593548d7e023e14cd39b', "aria-label": this.tdsScrollRightAriaLabel, class: {
183
185
  'scroll-right-button': true,
184
186
  'show': this.showRightScroll,
185
- }, onClick: () => this.scrollRight(), disabled: !this.showRightScroll }, index.h("tds-icon", { key: '9b84ae33c083f41ce6d8a83da1f1edb37c95de55', name: "chevron_right", size: "20px" })))));
187
+ }, onClick: () => this.scrollRight(), disabled: !this.showRightScroll }, index.h("tds-icon", { key: '451a8ddc680799fd86e390d8aeab5c22c73f31ee', name: "chevron_right", size: "20px" })))));
186
188
  }
187
189
  get host() { return index.getElement(this); }
188
190
  static get watchers() { return {