@scania/tegel 1.27.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.
Files changed (205) 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-dropdown_2.cjs.entry.js +8 -8
  4. package/dist/cjs/tds-footer-group.cjs.entry.js +27 -5
  5. package/dist/cjs/tds-footer-item.cjs.entry.js +2 -2
  6. package/dist/cjs/tds-footer.cjs.entry.js +1 -1
  7. package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +6 -2
  8. package/dist/cjs/tds-header-dropdown.cjs.entry.js +26 -3
  9. package/dist/cjs/tds-header-hamburger.cjs.entry.js +7 -1
  10. package/dist/cjs/tds-header-launcher-button.cjs.entry.js +2 -1
  11. package/dist/cjs/tds-header-launcher.cjs.entry.js +23 -2
  12. package/dist/cjs/tds-icon.cjs.entry.js +3 -2
  13. package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
  14. package/dist/cjs/tds-modal.cjs.entry.js +75 -3
  15. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
  16. package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -2
  17. package/dist/cjs/tds-popover-core.cjs.entry.js +55 -11
  18. package/dist/cjs/tds-popover-menu-item.cjs.entry.js +2 -2
  19. package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
  20. package/dist/cjs/tds-radio-button.cjs.entry.js +3 -1
  21. package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
  22. package/dist/cjs/tds-step.cjs.entry.js +2 -1
  23. package/dist/cjs/tds-stepper.cjs.entry.js +2 -1
  24. package/dist/cjs/tds-text-field.cjs.entry.js +31 -16
  25. package/dist/cjs/tds-textarea.cjs.entry.js +27 -9
  26. package/dist/cjs/tds-toast.cjs.entry.js +10 -3
  27. package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
  28. package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
  29. package/dist/cjs/tegel.cjs.js +1 -1
  30. package/dist/collection/components/dropdown/dropdown.js +8 -8
  31. package/dist/collection/components/footer/footer-group/footer-group.css +23 -21
  32. package/dist/collection/components/footer/footer-group/footer-group.js +55 -5
  33. package/dist/collection/components/footer/footer-item/footer-item.css +17 -17
  34. package/dist/collection/components/footer/footer-item/footer-item.js +2 -2
  35. package/dist/collection/components/footer/footer.css +1 -1
  36. package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.css +1 -1
  37. package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +6 -2
  38. package/dist/collection/components/header/header-dropdown/header-dropdown.js +49 -3
  39. package/dist/collection/components/header/header-hamburger/header-hamburger.js +30 -1
  40. package/dist/collection/components/header/header-launcher/header-launcher.js +50 -2
  41. package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +19 -1
  42. package/dist/collection/components/icon/icon.js +21 -2
  43. package/dist/collection/components/modal/modal.css +48 -43
  44. package/dist/collection/components/modal/modal.js +103 -3
  45. package/dist/collection/components/popover-canvas/popover-canvas.js +21 -2
  46. package/dist/collection/components/popover-core/popover-core.js +63 -10
  47. package/dist/collection/components/popover-core/tds-popover-core.css +123 -66
  48. package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.js +2 -2
  49. package/dist/collection/components/popover-menu/popover-menu.js +1 -1
  50. package/dist/collection/components/radio-button/radio-button.js +37 -1
  51. package/dist/collection/components/spinner/spinner.css +62 -39
  52. package/dist/collection/components/stepper/step/step.js +19 -1
  53. package/dist/collection/components/stepper/stepper.js +20 -1
  54. package/dist/collection/components/tabs/inline-tabs/inline-tabs.css +0 -1
  55. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +2 -3
  56. package/dist/collection/components/text-field/text-field.css +21 -9
  57. package/dist/collection/components/text-field/text-field.js +48 -15
  58. package/dist/collection/components/textarea/textarea.css +11 -6
  59. package/dist/collection/components/textarea/textarea.js +61 -8
  60. package/dist/collection/components/toast/toast.js +45 -3
  61. package/dist/collection/components/toggle/toggle.js +2 -2
  62. package/dist/collection/components/tooltip/tooltip.js +2 -2
  63. package/dist/components/{p-2d93a742.js → p-1c606f82.js} +1 -1
  64. package/dist/components/p-252f3d4d.js +2098 -0
  65. package/dist/components/p-3dcfe1f4.js +115 -0
  66. package/dist/components/{p-53e4cdcf.js → p-789bb453.js} +5 -3
  67. package/dist/components/{p-4487c541.js → p-92fb75a7.js} +4 -2
  68. package/dist/components/{p-663b8e51.js → p-c0b84c59.js} +9 -9
  69. package/dist/components/{p-83db8b35.js → p-f8a36676.js} +5 -3
  70. package/dist/components/tds-accordion-item.js +1 -1
  71. package/dist/components/tds-banner.js +1 -1
  72. package/dist/components/tds-datetime.js +1 -1
  73. package/dist/components/tds-dropdown-option.js +1 -1
  74. package/dist/components/tds-dropdown.js +1 -1
  75. package/dist/components/tds-folder-tabs.js +1 -1
  76. package/dist/components/tds-footer-group.js +32 -8
  77. package/dist/components/tds-footer-item.js +3 -3
  78. package/dist/components/tds-footer.js +1 -1
  79. package/dist/components/tds-header-brand-symbol.js +6 -2
  80. package/dist/components/tds-header-cell.js +1 -1
  81. package/dist/components/tds-header-dropdown.js +31 -7
  82. package/dist/components/tds-header-hamburger.js +11 -3
  83. package/dist/components/tds-header-launcher-button.js +1 -1
  84. package/dist/components/tds-header-launcher.js +29 -7
  85. package/dist/components/tds-icon.js +1 -1
  86. package/dist/components/tds-inline-tabs.js +2 -2
  87. package/dist/components/tds-message.js +1 -1
  88. package/dist/components/tds-modal.js +79 -5
  89. package/dist/components/tds-navigation-tabs.js +2 -2
  90. package/dist/components/tds-popover-canvas.js +1 -1
  91. package/dist/components/tds-popover-core.js +1 -1
  92. package/dist/components/tds-popover-menu-item.js +2 -2
  93. package/dist/components/tds-popover-menu.js +2 -2
  94. package/dist/components/tds-radio-button.js +6 -2
  95. package/dist/components/tds-side-menu-close-button.js +1 -1
  96. package/dist/components/tds-side-menu-dropdown.js +1 -1
  97. package/dist/components/tds-slider.js +1 -1
  98. package/dist/components/tds-spinner.js +1 -1
  99. package/dist/components/tds-step.js +4 -2
  100. package/dist/components/tds-stepper.js +4 -2
  101. package/dist/components/tds-table-body-input-wrapper.js +1 -1
  102. package/dist/components/tds-table-footer.js +3 -3
  103. package/dist/components/tds-table-header-input-wrapper.js +1 -1
  104. package/dist/components/tds-table-toolbar.js +1 -1
  105. package/dist/components/tds-text-field.js +33 -17
  106. package/dist/components/tds-textarea.js +43 -11
  107. package/dist/components/tds-toast.js +13 -4
  108. package/dist/components/tds-toggle.js +2 -2
  109. package/dist/components/tds-tooltip.js +1 -113
  110. package/dist/esm/index-51d04e39.js +4 -4
  111. package/dist/esm/loader.js +1 -1
  112. package/dist/esm/tds-dropdown_2.entry.js +8 -8
  113. package/dist/esm/tds-footer-group.entry.js +27 -5
  114. package/dist/esm/tds-footer-item.entry.js +3 -3
  115. package/dist/esm/tds-footer.entry.js +1 -1
  116. package/dist/esm/tds-header-brand-symbol.entry.js +6 -2
  117. package/dist/esm/tds-header-dropdown.entry.js +26 -3
  118. package/dist/esm/tds-header-hamburger.entry.js +7 -1
  119. package/dist/esm/tds-header-launcher-button.entry.js +2 -1
  120. package/dist/esm/tds-header-launcher.entry.js +23 -2
  121. package/dist/esm/tds-icon.entry.js +3 -2
  122. package/dist/esm/tds-inline-tabs.entry.js +1 -1
  123. package/dist/esm/tds-modal.entry.js +75 -3
  124. package/dist/esm/tds-navigation-tabs.entry.js +1 -1
  125. package/dist/esm/tds-popover-canvas.entry.js +3 -2
  126. package/dist/esm/tds-popover-core.entry.js +55 -11
  127. package/dist/esm/tds-popover-menu-item.entry.js +2 -2
  128. package/dist/esm/tds-popover-menu.entry.js +1 -1
  129. package/dist/esm/tds-radio-button.entry.js +3 -1
  130. package/dist/esm/tds-spinner.entry.js +1 -1
  131. package/dist/esm/tds-step.entry.js +2 -1
  132. package/dist/esm/tds-stepper.entry.js +2 -1
  133. package/dist/esm/tds-text-field.entry.js +31 -16
  134. package/dist/esm/tds-textarea.entry.js +27 -9
  135. package/dist/esm/tds-toast.entry.js +10 -3
  136. package/dist/esm/tds-toggle.entry.js +2 -2
  137. package/dist/esm/tds-tooltip.entry.js +2 -2
  138. package/dist/esm/tegel.js +1 -1
  139. package/dist/tegel/p-033d991e.entry.js +1 -0
  140. package/dist/tegel/p-24db6b5b.entry.js +1 -0
  141. package/dist/tegel/p-27a4a7d0.entry.js +1 -0
  142. package/dist/tegel/p-28cf7204.entry.js +1 -0
  143. package/dist/tegel/p-302fea99.entry.js +1 -0
  144. package/dist/tegel/p-31bc440c.entry.js +1 -0
  145. package/dist/tegel/p-3e9ca19a.entry.js +1 -0
  146. package/dist/tegel/p-44ac6a20.entry.js +1 -0
  147. package/dist/tegel/{p-769d0503.entry.js → p-46205cfb.entry.js} +1 -1
  148. package/dist/tegel/p-54a20280.entry.js +1 -0
  149. package/dist/tegel/p-5a3ff0d3.entry.js +1 -0
  150. package/dist/tegel/p-660176d6.entry.js +1 -0
  151. package/dist/tegel/{p-eaa279dd.entry.js → p-81111221.entry.js} +1 -1
  152. package/dist/tegel/{p-668b7662.entry.js → p-8d7bf652.entry.js} +1 -1
  153. package/dist/tegel/p-b58f68f0.entry.js +1 -0
  154. package/dist/tegel/{p-5ba254ee.entry.js → p-c10be10e.entry.js} +1 -1
  155. package/dist/tegel/p-c71acb02.entry.js +1 -0
  156. package/dist/tegel/p-ceab8f75.entry.js +1 -0
  157. package/dist/tegel/p-e1abd593.entry.js +1 -0
  158. package/dist/tegel/p-e3c3bdac.entry.js +1 -0
  159. package/dist/tegel/p-e46744bc.entry.js +1 -0
  160. package/dist/tegel/p-ea9e7345.entry.js +1 -0
  161. package/dist/tegel/{p-97f10223.entry.js → p-eec22b6b.entry.js} +1 -1
  162. package/dist/tegel/p-f034fc0c.entry.js +1 -0
  163. package/dist/tegel/p-fa342278.entry.js +1 -0
  164. package/dist/tegel/{p-b9f81e53.entry.js → p-fc6196c4.entry.js} +1 -1
  165. package/dist/tegel/tegel.css +4 -4
  166. package/dist/tegel/tegel.esm.js +1 -1
  167. package/dist/types/components/footer/footer-group/footer-group.d.ts +7 -0
  168. package/dist/types/components/header/header-brand-symbol/header-brand-symbol.d.ts +1 -1
  169. package/dist/types/components/header/header-dropdown/header-dropdown.d.ts +4 -0
  170. package/dist/types/components/header/header-hamburger/header-hamburger.d.ts +3 -0
  171. package/dist/types/components/header/header-launcher/header-launcher.d.ts +4 -0
  172. package/dist/types/components/header/header-launcher-button/header-launcher-button.d.ts +2 -0
  173. package/dist/types/components/icon/icon.d.ts +2 -0
  174. package/dist/types/components/modal/modal.d.ts +6 -0
  175. package/dist/types/components/popover-canvas/popover-canvas.d.ts +2 -0
  176. package/dist/types/components/popover-core/popover-core.d.ts +4 -0
  177. package/dist/types/components/radio-button/radio-button.d.ts +4 -0
  178. package/dist/types/components/stepper/step/step.d.ts +1 -0
  179. package/dist/types/components/stepper/stepper.d.ts +2 -0
  180. package/dist/types/components/text-field/text-field.d.ts +6 -4
  181. package/dist/types/components/textarea/textarea.d.ts +10 -4
  182. package/dist/types/components/toast/toast.d.ts +5 -0
  183. package/dist/types/components.d.ts +130 -0
  184. package/package.json +1 -1
  185. package/dist/components/p-90dbeab3.js +0 -2052
  186. package/dist/tegel/p-035e58e6.entry.js +0 -1
  187. package/dist/tegel/p-22c592eb.entry.js +0 -1
  188. package/dist/tegel/p-288a09ef.entry.js +0 -1
  189. package/dist/tegel/p-4f5f152a.entry.js +0 -1
  190. package/dist/tegel/p-542d7b3e.entry.js +0 -1
  191. package/dist/tegel/p-5a7110b8.entry.js +0 -1
  192. package/dist/tegel/p-5db5c8f4.entry.js +0 -1
  193. package/dist/tegel/p-654785d2.entry.js +0 -1
  194. package/dist/tegel/p-66f394a2.entry.js +0 -1
  195. package/dist/tegel/p-727f873f.entry.js +0 -1
  196. package/dist/tegel/p-746e2927.entry.js +0 -1
  197. package/dist/tegel/p-754a4921.entry.js +0 -1
  198. package/dist/tegel/p-aef6b130.entry.js +0 -1
  199. package/dist/tegel/p-b114ec3d.entry.js +0 -1
  200. package/dist/tegel/p-b39ffad4.entry.js +0 -1
  201. package/dist/tegel/p-b686f1ad.entry.js +0 -1
  202. package/dist/tegel/p-c56be8d1.entry.js +0 -1
  203. package/dist/tegel/p-dfbbaefd.entry.js +0 -1
  204. package/dist/tegel/p-ea3e071f.entry.js +0 -1
  205. package/dist/tegel/p-ee7f07ae.entry.js +0 -1
@@ -13,6 +13,7 @@ const TdsHeaderLauncher = class {
13
13
  this.open = false;
14
14
  this.buttonEl = undefined;
15
15
  this.hasListTypeMenu = false;
16
+ this.tdsAriaLabel = undefined;
16
17
  }
17
18
  onAnyClick(event) {
18
19
  // Source: https://lamplightdev.com/blog/2021/04/10/how-to-detect-clicks-outside-of-a-web-component/
@@ -21,12 +22,32 @@ const TdsHeaderLauncher = class {
21
22
  this.open = false;
22
23
  }
23
24
  }
25
+ handleKeyDown(event) {
26
+ if (event.key === 'Escape' && this.open) {
27
+ this.open = false;
28
+ this.buttonEl.shadowRoot.querySelector('button').focus();
29
+ }
30
+ }
24
31
  componentDidLoad() {
25
32
  const hasListTypeMenu = !!this.host.querySelector('tds-header-launcher-list');
26
33
  this.hasListTypeMenu = hasListTypeMenu;
27
34
  }
28
35
  toggleLauncher() {
29
36
  this.open = !this.open;
37
+ if (this.open) {
38
+ requestAnimationFrame(() => {
39
+ const selectors = "a, [tabindex='0']";
40
+ const firstFocusableElement = this.host.shadowRoot.querySelector(selectors) || this.host.querySelector(selectors);
41
+ if (firstFocusableElement instanceof HTMLElement) {
42
+ firstFocusableElement.focus();
43
+ }
44
+ });
45
+ }
46
+ }
47
+ connectedCallback() {
48
+ if (!this.tdsAriaLabel) {
49
+ console.warn('Tegel Header Launcher component: missing tdsAriaLabel prop');
50
+ }
30
51
  }
31
52
  render() {
32
53
  this.ariaAttributes = Object.assign(Object.assign({}, this.ariaAttributes), inheritAriaAttributes(this.host, ['role']));
@@ -35,11 +56,11 @@ const TdsHeaderLauncher = class {
35
56
  }, 'ref': (el) => {
36
57
  this.buttonEl = el;
37
58
  } });
38
- return (h(Host, { key: 'd886168b8834ced8a2705b30b9982726dc72f8b6' }, h("div", { key: '0c4b9b27e82cf91c000619ef8d0593f8b664b605', class: {
59
+ return (h(Host, { key: '3a0100f1429a1e09a5745c6b74835bddb6ba5157' }, h("div", { key: '50220e92372ac5496a4b589441e4920375169e79', class: {
39
60
  'wrapper': true,
40
61
  'state-open': this.open,
41
62
  'state-list-type-menu': this.hasListTypeMenu,
42
- } }, h("tds-header-launcher-button", Object.assign({ key: 'd0ff7205bf79ef4744d65dcf98734aff5520b004' }, buttonAttributes)), this.buttonEl && (h("tds-popover-canvas", { key: 'c337c31282b08c5add95b16271bdfc147fd16c5c', id: `tds-launcher-${this.uuid}`, class: "menu", referenceEl: this.buttonEl, placement: "bottom-start", show: this.open, offsetDistance: 0, modifiers: [
63
+ } }, h("tds-header-launcher-button", Object.assign({ key: 'd58c3ba5f08809487eeca1e6ce8a31879f0c52d9' }, buttonAttributes, { "tds-aria-label": this.tdsAriaLabel })), this.buttonEl && (h("tds-popover-canvas", { key: '4806b02e07aef32a640eedc1f0f76285950ec384', id: `tds-launcher-${this.uuid}`, class: "menu", referenceEl: this.buttonEl, placement: "bottom-start", show: this.open, offsetDistance: 0, modifiers: [
43
64
  {
44
65
  name: 'flip',
45
66
  options: {
@@ -11,12 +11,13 @@ const Icon = class {
11
11
  registerInstance(this, hostRef);
12
12
  this.setIcons = () => this.arrayOfIcons.map((element) => {
13
13
  if (element.name === this.name) {
14
- return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": this.svgTitle ? `title-${this.name}` : undefined, "aria-describedby": this.svgDescription ? `desc-${this.name}` : undefined, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, this.svgTitle && h("title", { id: `title-${this.name}` }, this.svgTitle), this.svgDescription && h("desc", { id: `desc-${this.name}` }, this.svgDescription), h("path", { fill: "currentColor", d: element.definition })));
14
+ return (h("svg", { "aria-hidden": this.tdsAriaHidden, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": this.svgTitle ? `title-${this.name}` : undefined, "aria-describedby": this.svgDescription ? `desc-${this.name}` : undefined, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, this.svgTitle && h("title", { id: `title-${this.name}` }, this.svgTitle), this.svgDescription && h("desc", { id: `desc-${this.name}` }, this.svgDescription), h("path", { fill: "currentColor", d: element.definition })));
15
15
  }
16
16
  });
17
17
  this.name = 'truck';
18
18
  this.size = '16px';
19
19
  this.svgTitle = undefined;
20
+ this.tdsAriaHidden = false;
20
21
  this.svgDescription = undefined;
21
22
  this.icons_object = iconsCollection;
22
23
  this.arrayOfIcons = [];
@@ -34,7 +35,7 @@ const Icon = class {
34
35
  this.arrayOfIcons = [...this.arrayOfIcons];
35
36
  }
36
37
  render() {
37
- return h(Host, { key: '7501bac4e182e5b44030b140b4c2c68e0fd2522b' }, this.setIcons());
38
+ return h(Host, { key: 'd19a1de2f0267b93717324d424b9c89e19bbcb21' }, this.setIcons());
38
39
  }
39
40
  };
40
41
  Icon.style = TdsIconStyle0;
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
2
2
 
3
- const inlineTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-inline-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-inline-tabs-horizontal-divider-background);opacity:var(--tds-inline-tabs-horizontal-divider-opacity);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
3
+ const inlineTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-inline-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-inline-tabs-horizontal-divider-background);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
4
4
  const TdsInlineTabsStyle0 = inlineTabsCss;
5
5
 
6
6
  const TdsInlineTabs = class {
@@ -1,7 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
2
2
  import { h as hasSlot } from './hasSlot-d52114d0.js';
3
+ import { g as generateUniqueId } from './generateUniqueId-7934d315.js';
3
4
 
4
- 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}";
5
+ const modalCss = ".tds-modal{box-sizing:border-box;background-color:var(--background-elevation-layer-02);margin:auto;position:relative;border-radius:var(--radius-narrow);max-height:85vh;overflow-y:auto;pointer-events:auto}.tds-modal *{box-sizing:border-box}.tds-modal::-webkit-scrollbar{width:6px;background-color:transparent}.tds-modal::-webkit-scrollbar-track{background-color:transparent}.tds-modal::-webkit-scrollbar-thumb{background-color:var(--foreground-elements-transparparent-discrete);border-radius:3px}.tds-modal__actions-sticky{overflow:hidden;display:flex;flex-direction:column}.tds-modal__actions-sticky .body{font-family:var(--body-01-font-family);font-size:var(--body-01-font-size);line-height:var(--body-01-line-height);font-weight:var(--body-01-font-weight);letter-spacing:var(--body-01-letter-spacing);text-transform:var(--body-01-text-transform);max-height:calc(85vh - 36px);overflow-y:auto}.tds-modal__actions-sticky slot[name=actions]{bottom:-1px;left:0;right:0;background-color:var(--background-elevation-layer-02);padding:24px 16px 16px;display:flex;gap:16px}.tds-modal__actions-static slot[name=actions]{background-color:var(--background-elevation-layer-02);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:16px;position:sticky;top:0;background-color:var(--background-elevation-layer-02);z-index:1}.header,slot[name=header]::slotted(*){font-family:var(--headline-05-font-family);font-size:var(--headline-05-font-size);line-height:var(--headline-05-line-height);font-weight:var(--headline-05-font-weight);letter-spacing:var(--headline-05-letter-spacing);text-transform:var(--headline-05-text-transform);color:var(--foreground-text-strong);margin:0;flex:1}.body{font-family:var(--body-01-font-family);font-size:var(--body-01-font-size);line-height:var(--body-01-line-height);font-weight:var(--body-01-font-weight);letter-spacing:var(--body-01-letter-spacing);text-transform:var(--body-01-text-transform);color:var(--foreground-text-strong);overflow-y:visible;padding:0 16px 16px}.body::-webkit-scrollbar{width:6px;background-color:transparent}.body::-webkit-scrollbar-track{background-color:transparent}.body::-webkit-scrollbar-thumb{background-color:var(--foreground-elements-transparparent-discrete);border-radius:3px}.tds-modal-backdrop{box-sizing:border-box;position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--background-elevation-scrim);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(--foreground-text-strong);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:16px}}@media (min-width: 1056px){.tds-modal-close{margin-left:48px}}.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:16px}}@media (min-width: 1056px){.tds-modal-close-btn{margin-left:48px}}.tds-modal-close-btn svg{fill:var(--foreground-text-strong)}.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}";
5
6
  const TdsModalStyle0 = modalCss;
6
7
 
7
8
  const TdsModal = class {
@@ -10,6 +11,7 @@ const TdsModal = class {
10
11
  this.tdsClose = createEvent(this, "tdsClose", 7);
11
12
  this.handleClose = (event) => {
12
13
  const closeEvent = this.tdsClose.emit(event);
14
+ this.returnFocusOnClose();
13
15
  if (!closeEvent.defaultPrevented) {
14
16
  this.isShown = false;
15
17
  }
@@ -58,15 +60,26 @@ const TdsModal = class {
58
60
  this.referenceEl = undefined;
59
61
  this.show = undefined;
60
62
  this.closable = true;
63
+ this.tdsAlertDialog = 'dialog';
61
64
  this.isShown = false;
65
+ this.activeElementIndex = 0;
62
66
  }
63
67
  /** Shows the Modal. */
64
68
  async showModal() {
65
69
  this.isShown = true;
70
+ // Set focus on first element when opened
71
+ requestAnimationFrame(() => {
72
+ const focusableElements = this.getFocusableElements();
73
+ if (focusableElements.length > 0) {
74
+ focusableElements[0].focus();
75
+ this.activeElementIndex = 0;
76
+ }
77
+ });
66
78
  }
67
79
  /** Closes the Modal. */
68
80
  async closeModal() {
69
81
  this.isShown = false;
82
+ this.returnFocusOnClose();
70
83
  }
71
84
  connectedCallback() {
72
85
  if (this.closable === undefined) {
@@ -104,6 +117,63 @@ const TdsModal = class {
104
117
  dismissButton.removeEventListener('click', this.handleClose);
105
118
  });
106
119
  }
120
+ returnFocusOnClose() {
121
+ var _a;
122
+ let referenceEl = (_a = this.referenceEl) !== null && _a !== void 0 ? _a : document.querySelector(this.selector);
123
+ const potentialReferenceElements = ['BUTTON', 'A', 'INPUT'];
124
+ // If referenced element is a custom element eg: tds-button we find the interactive element inside
125
+ if (potentialReferenceElements.indexOf(referenceEl.tagName) < 0) {
126
+ referenceEl = referenceEl.querySelectorAll(potentialReferenceElements.join(','))[0];
127
+ }
128
+ referenceEl.focus();
129
+ }
130
+ getFocusableElements() {
131
+ const focusableSelectors = [
132
+ 'a[href]',
133
+ 'button:not([disabled])',
134
+ 'textarea:not([disabled])',
135
+ 'input:not([disabled])',
136
+ 'select:not([disabled])',
137
+ '[tabindex]:not([tabindex="-1"])',
138
+ ].join(',');
139
+ const focusableInShadowRoot = Array.from(this.host.shadowRoot.querySelectorAll(focusableSelectors));
140
+ const focusableInSlots = Array.from(this.host.querySelectorAll(focusableSelectors));
141
+ /** Focusable elements */
142
+ return [...focusableInShadowRoot, ...focusableInSlots];
143
+ }
144
+ handleFocusTrap(event) {
145
+ if (event.key === 'Escape' && this.isShown && !this.prevent) {
146
+ this.handleClose(event);
147
+ return;
148
+ }
149
+ // Only trap focus if the modal is open
150
+ if (!this.isShown)
151
+ return;
152
+ // We care only about the Tab key
153
+ if (event.key !== 'Tab')
154
+ return;
155
+ const focusableElements = this.getFocusableElements();
156
+ // If there are no focusable elements
157
+ if (focusableElements.length === 0)
158
+ return;
159
+ event.preventDefault();
160
+ // Going backwards (Shift + Tab) on the first element => move to last
161
+ if (event.shiftKey) {
162
+ this.activeElementIndex -= 1;
163
+ if (this.activeElementIndex === -1) {
164
+ this.activeElementIndex = focusableElements.length - 1;
165
+ }
166
+ }
167
+ // // Going forwards (Tab) on the last element => move to first
168
+ if (!event.shiftKey) {
169
+ this.activeElementIndex += 1;
170
+ if (this.activeElementIndex === focusableElements.length) {
171
+ this.activeElementIndex = 0;
172
+ }
173
+ }
174
+ const nextElement = focusableElements[this.activeElementIndex];
175
+ nextElement.focus();
176
+ }
107
177
  /** Adds an event listener to the dismiss buttons that closes the Modal. */
108
178
  setDismissButtons() {
109
179
  this.host.querySelectorAll('[data-dismiss-modal]').forEach((dismissButton) => {
@@ -113,10 +183,12 @@ const TdsModal = class {
113
183
  render() {
114
184
  const usesHeaderSlot = hasSlot('header', this.host);
115
185
  const usesActionsSlot = hasSlot('actions', this.host);
116
- return (h(Host, { key: '3b815395be0ccab91eebda3ca785528de624d17e', class: {
186
+ const headerId = this.header ? `tds-modal-header-${generateUniqueId()}` : undefined;
187
+ const bodyId = `tds-modal-body-${generateUniqueId()}`;
188
+ return (h(Host, { key: '398809ea45126dd70b95422f2f7a08a481a22d53', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
117
189
  show: this.isShown,
118
190
  hide: !this.isShown,
119
- }, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '84c9952f862e5defe06c04040e7031e08c5caca3', class: "tds-modal-backdrop" }), h("div", { key: '42b3ea985203a582b3a3dee5250b4a4468a23d6f', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: '06e005618aeab759c01f7d556cc4357f0aed0e1d', class: "header" }, this.header && h("div", { key: 'bff8080a479c4ecef96eae35dc0f33cc3fadaa8c', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: 'dbec4b999fcda87c5c751a8cf3eb7b9f66e1ec43', name: "header" }), this.closable && (h("button", { key: 'bfbfe0d3419aa5e2a5fcbab7691560ed5619dd05', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: '3bcd38d4234a689acd63bb82e21b270c2b0825f9', name: "cross", size: "20px" })))), h("div", { key: '2fc5756d3261dfa354ce3025dc9d8ff213c49ba1', class: "body" }, h("slot", { key: '389ac6e307873c9de7c36c0960ce578cdfaf88e4', name: "body" })), usesActionsSlot && h("slot", { key: 'c964f9d3999f26995543187c553adcc9ac392f2a', name: "actions" }))));
191
+ }, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '96e964cc4f3c6d9613fb53e340e0aa5dcd8b6d81', class: "tds-modal-backdrop" }), h("div", { key: 'af7ddc896ef35b6116ae70524d10c4b7b952e20a', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: '9dfcf95fcc8925cd5c97f10f29edc6cef183a0ca', id: headerId, class: "header" }, this.header && h("div", { key: '42533c25b07e696a0c61504556150018f8d3583a', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: 'd9855a20e1763ad17d6c8b80df85796d8f6027a8', name: "header" }), this.closable && (h("button", { key: '3e99b76da7bcf39eaecbe2906e0674fd20ebe9a6', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: 'f6463437fb98ae280afe358d50a2f960914014ea', name: "cross", size: "20px" })))), h("div", { key: 'ba8ca2e65f5eac8103e6f3c431e3ae9aab2b5f72', id: bodyId, class: "body" }, h("slot", { key: '9e08cbdd00e1a60826588b15cb6ed23fc4b5b0d7', name: "body" })), usesActionsSlot && h("slot", { key: 'aeb50dfcbf6c12e80a8904d149bb15892c691d88', name: "actions" }))));
120
192
  }
121
193
  get host() { return getElement(this); }
122
194
  };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-51d04e39.js';
2
2
 
3
- const navigationTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-inline-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-inline-tabs-horizontal-divider-background);opacity:var(--tds-inline-tabs-horizontal-divider-opacity);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
3
+ const navigationTabsCss = ":host{box-sizing:border-box;display:flex;background-color:var(--tds-navigation-tabs-background);position:relative}:host *{box-sizing:border-box}:host::after{content:\" \";display:block;border-bottom:1px solid var(--tds-navigation-tabs-horizontal-divider-background);left:0;right:0;bottom:0;position:absolute}:host .wrapper{display:flex;flex-wrap:nowrap;white-space:nowrap;width:100%;overflow-x:scroll;scrollbar-width:none;gap:16px}:host .wrapper::-webkit-scrollbar{display:none}:host .scroll-right-button{right:0;z-index:1}:host .scroll-left-button{left:0;z-index:1}:host .scroll-right-button,:host .scroll-left-button{color:var(--tds-folder-tabs-scroll-btn-color);cursor:pointer;border:0;width:0;background-color:var(--tds-inline-tabs-scroll-btn-background);display:none;justify-content:center;align-items:center;opacity:0;pointer-events:none;position:sticky}:host .scroll-right-button.show,:host .scroll-left-button.show{min-width:48px;display:block;opacity:1;pointer-events:all}:host .scroll-right-button:hover,:host .scroll-left-button:hover{background-color:var(--tds-folder-tabs-scroll-btn-background-hover)}:host .scroll-right-button:active,:host .scroll-left-button:active{background-color:var(--tds-folder-tabs-scroll-btn-background-active)}:host .scroll-right-button:focus,:host .scroll-left-button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .scroll-right-button svg,:host .scroll-left-button svg{fill:var(--tds-folder-tabs-scroll-btn-color)}";
4
4
  const TdsNavigationTabsStyle0 = navigationTabsCss;
5
5
 
6
6
  const TdsNavigationTabs = class {
@@ -17,6 +17,7 @@ const TdsPopoverCanvas = class {
17
17
  this.animation = 'none';
18
18
  this.offsetDistance = 8;
19
19
  this.modifiers = [];
20
+ this.tdsAlertDialog = 'dialog';
20
21
  this.childRef = undefined;
21
22
  }
22
23
  /** Property for closing popover programmatically */
@@ -29,12 +30,12 @@ const TdsPopoverCanvas = class {
29
30
  }
30
31
  render() {
31
32
  var _a;
32
- return (h(Host, { key: '68de2e7161c5060c98b1c0c78050f41a716228ee' }, h("tds-popover-core", Object.assign({ key: 'f50ae36ac2b76445d78cbe4750820d3c684e862a' }, this.inheritedAttributes, { class: {
33
+ return (h(Host, { key: '65f267d001dc720000b13f6b46010781ccd3119c' }, h("tds-popover-core", Object.assign({ key: '5a3df2dbc918a330f895fbfb4bbf1a5a6ebe2c21', role: this.tdsAlertDialog }, this.inheritedAttributes, { class: {
33
34
  'tds-popover-canvas': true,
34
35
  [(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
35
36
  }, selector: this.selector, referenceEl: this.referenceEl, show: this.show, placement: this.placement, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, modifiers: this.modifiers, trigger: 'click', ref: (el) => {
36
37
  this.childRef = el;
37
- }, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: '1dac1d925ab9673219449d3885cd7430a3e3f188' }, h("slot", { key: '9c5d3c152b63e0afd8c30e4960edbd2aa3418fd2' })))));
38
+ }, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: '3c24d23c70824186c971ce3cfe79d2d14ac472a1' }, h("slot", { key: 'ca58b5e939aabdbe80ca92d747c191f08ad34b4d' })))));
38
39
  }
39
40
  get host() { return getElement(this); }
40
41
  };