@scania/tegel 1.38.0-text-field-support-aria-invalid-beta.0 → 1.39.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 (128) hide show
  1. package/dist/cjs/getAriaInvalid-66a2eade.js +25 -0
  2. package/dist/cjs/index-ca8040ad.js +6 -10
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
  5. package/dist/cjs/{tds-button.cjs.entry.js → tds-button_2.cjs.entry.js} +25 -0
  6. package/dist/cjs/tds-card.cjs.entry.js +10 -3
  7. package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
  8. package/dist/cjs/tds-dropdown_2.cjs.entry.js +55 -22
  9. package/dist/cjs/tds-link.cjs.entry.js +1 -1
  10. package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
  11. package/dist/cjs/tds-popover-canvas.cjs.entry.js +6 -3
  12. package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +4 -6
  13. package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
  14. package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
  15. package/dist/cjs/tds-slider.cjs.entry.js +39 -10
  16. package/dist/cjs/tds-text-field.cjs.entry.js +2 -29
  17. package/dist/cjs/tds-textarea.cjs.entry.js +5 -3
  18. package/dist/cjs/tds-toast.cjs.entry.js +1 -1
  19. package/dist/cjs/tegel.cjs.js +1 -1
  20. package/dist/collection/components/accordion/accordion-item/accordion-item.css +8 -4
  21. package/dist/collection/components/card/card.css +12 -0
  22. package/dist/collection/components/card/card.js +45 -2
  23. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +13 -3
  24. package/dist/collection/components/dropdown/dropdown.js +56 -20
  25. package/dist/collection/components/header/header-item/header-item.css +3 -3
  26. package/dist/collection/components/link/link.css +13 -15
  27. package/dist/collection/components/popover-canvas/popover-canvas.css +1 -1
  28. package/dist/collection/components/popover-canvas/popover-canvas.js +26 -10
  29. package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +4 -6
  30. package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +84 -6
  31. package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +82 -6
  32. package/dist/collection/components/slider/slider.css +24 -28
  33. package/dist/collection/components/slider/slider.js +38 -9
  34. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.css +1 -1
  35. package/dist/collection/components/textarea/textarea.js +5 -3
  36. package/dist/collection/components/toast/toast.css +7 -7
  37. package/dist/collection/utils/getAriaInvalid.js +0 -6
  38. package/dist/components/{p-63437b77.js → p-072bf53a.js} +1 -1
  39. package/dist/components/p-3b58a9f3.js +188 -0
  40. package/dist/components/{p-ea381f94.js → p-92c2da85.js} +1 -1
  41. package/dist/components/{p-6adb1ce3.js → p-ad6babcd.js} +1 -1
  42. package/dist/components/p-bbf9492a.js +23 -0
  43. package/dist/components/{p-d64878cb.js → p-c4318e35.js} +13 -3
  44. package/dist/{esm/tds-button.entry.js → components/p-c8dc3566.js} +37 -9
  45. package/dist/components/{p-94bfc9f4.js → p-de36fc8a.js} +44 -20
  46. package/dist/components/{p-df84759a.js → p-f04f04b5.js} +7 -3
  47. package/dist/components/tds-accordion-item.js +1 -1
  48. package/dist/components/tds-button.js +1 -89
  49. package/dist/components/tds-card.js +27 -6
  50. package/dist/components/tds-dropdown-option.js +1 -1
  51. package/dist/components/tds-dropdown.js +1 -1
  52. package/dist/components/tds-header-brand-symbol.js +1 -1
  53. package/dist/components/tds-header-dropdown.js +2 -2
  54. package/dist/components/tds-header-hamburger.js +1 -1
  55. package/dist/components/tds-header-item.js +1 -1
  56. package/dist/components/tds-header-launcher-button.js +1 -1
  57. package/dist/components/tds-header-launcher.js +3 -3
  58. package/dist/components/tds-link.js +1 -1
  59. package/dist/components/tds-navigation-tab.js +1 -1
  60. package/dist/components/tds-popover-canvas.js +1 -1
  61. package/dist/components/tds-side-menu-collapse-button.js +5 -7
  62. package/dist/components/tds-side-menu-dropdown-list-item.js +1 -1
  63. package/dist/components/tds-side-menu-dropdown.js +1 -1
  64. package/dist/components/tds-side-menu-item.js +1 -1
  65. package/dist/components/tds-slider.js +59 -12
  66. package/dist/components/tds-table-footer.js +2 -2
  67. package/dist/components/tds-text-field.js +1 -213
  68. package/dist/components/tds-textarea.js +5 -3
  69. package/dist/components/tds-toast.js +1 -1
  70. package/dist/esm/getAriaInvalid-a9944cb9.js +23 -0
  71. package/dist/esm/index-51d04e39.js +6 -10
  72. package/dist/esm/loader.js +1 -1
  73. package/dist/esm/tds-accordion-item.entry.js +1 -1
  74. package/dist/esm/tds-button_2.entry.js +87 -0
  75. package/dist/esm/tds-card.entry.js +10 -3
  76. package/dist/esm/tds-core-header-item_2.entry.js +1 -1
  77. package/dist/esm/tds-dropdown_2.entry.js +55 -22
  78. package/dist/esm/tds-link.entry.js +1 -1
  79. package/dist/esm/tds-navigation-tab.entry.js +1 -1
  80. package/dist/esm/tds-popover-canvas.entry.js +6 -3
  81. package/dist/esm/tds-side-menu-collapse-button.entry.js +4 -6
  82. package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
  83. package/dist/esm/tds-side-menu-item.entry.js +1 -1
  84. package/dist/esm/tds-slider.entry.js +39 -10
  85. package/dist/esm/tds-text-field.entry.js +1 -28
  86. package/dist/esm/tds-textarea.entry.js +6 -4
  87. package/dist/esm/tds-toast.entry.js +1 -1
  88. package/dist/esm/tegel.js +1 -1
  89. package/dist/tegel/p-1859156f.entry.js +1 -0
  90. package/dist/tegel/p-2c9ea0be.entry.js +1 -0
  91. package/dist/tegel/p-2f9b15f6.entry.js +1 -0
  92. package/dist/tegel/p-30901c4d.entry.js +1 -0
  93. package/dist/tegel/p-336f2de3.entry.js +1 -0
  94. package/dist/tegel/p-35293420.entry.js +1 -0
  95. package/dist/tegel/p-4a666337.entry.js +1 -0
  96. package/dist/tegel/p-628dc7f7.entry.js +1 -0
  97. package/dist/tegel/p-83e6e31f.entry.js +1 -0
  98. package/dist/tegel/p-87740f23.entry.js +1 -0
  99. package/dist/tegel/{p-a74cb560.entry.js → p-af63a774.entry.js} +1 -1
  100. package/dist/tegel/p-bbf9492a.js +1 -0
  101. package/dist/tegel/p-c465f9b8.entry.js +1 -0
  102. package/dist/tegel/p-c4f701f6.entry.js +1 -0
  103. package/dist/tegel/{p-5734c6ef.entry.js → p-c61ecc8e.entry.js} +1 -1
  104. package/dist/tegel/{p-db38b4f2.entry.js → p-ecb34850.entry.js} +1 -1
  105. package/dist/tegel/tegel.css +2 -2
  106. package/dist/tegel/tegel.esm.js +1 -1
  107. package/dist/types/components/card/card.d.ts +10 -0
  108. package/dist/types/components/dropdown/dropdown.d.ts +4 -0
  109. package/dist/types/components/popover-canvas/popover-canvas.d.ts +3 -1
  110. package/dist/types/components/slider/slider.d.ts +2 -0
  111. package/dist/types/components/textarea/textarea.d.ts +1 -0
  112. package/dist/types/components.d.ts +26 -2
  113. package/package.json +1 -1
  114. package/dist/cjs/tds-divider.cjs.entry.js +0 -31
  115. package/dist/esm/tds-divider.entry.js +0 -27
  116. package/dist/tegel/p-06d3490c.entry.js +0 -1
  117. package/dist/tegel/p-25d026a6.entry.js +0 -1
  118. package/dist/tegel/p-3233451c.entry.js +0 -1
  119. package/dist/tegel/p-397c8969.entry.js +0 -1
  120. package/dist/tegel/p-49364819.entry.js +0 -1
  121. package/dist/tegel/p-4a77edf1.entry.js +0 -1
  122. package/dist/tegel/p-5c077bb9.entry.js +0 -1
  123. package/dist/tegel/p-61a1dc59.entry.js +0 -1
  124. package/dist/tegel/p-a0591e58.entry.js +0 -1
  125. package/dist/tegel/p-abad3489.entry.js +0 -1
  126. package/dist/tegel/p-ae438c2e.entry.js +0 -1
  127. package/dist/tegel/p-b994e7ac.entry.js +0 -1
  128. package/dist/tegel/p-cd5103e3.entry.js +0 -1
@@ -121,16 +121,20 @@
121
121
  margin-left: 0;
122
122
  margin-right: var(--tds-spacing-element-16);
123
123
  }
124
- .tds-accordion-item:first-child {
125
- margin-bottom: -1px;
126
- border-bottom: 1px solid var(--tds-accordion-border);
127
- }
128
124
  .tds-accordion-item:has(.tds-accordion-header-icon-start:focus-visible), .tds-accordion-item:has(.tds-accordion-header-icon-end:focus-visible) {
129
125
  outline: 2px solid var(--tds-focus-outline-color);
130
126
  box-shadow: 0 0 0 1px var(--tds-white);
131
127
  outline-offset: 1px;
132
128
  z-index: 1;
133
129
  background-color: var(--tds-accordion-background-focus);
130
+ margin-bottom: -1px;
131
+ border-bottom: 1px solid var(--tds-accordion-border);
132
+ }
133
+ .tds-accordion-item:has(.tds-accordion-header-icon-start:focus-visible):hover, .tds-accordion-item:has(.tds-accordion-header-icon-end:focus-visible):hover {
134
+ background-color: var(--tds-accordion-background-hover);
135
+ }
136
+ .tds-accordion-item:has(.tds-accordion-header-icon-start:focus-visible):active, .tds-accordion-item:has(.tds-accordion-header-icon-end:focus-visible):active {
137
+ background-color: var(--tds-accordion-background-active);
134
138
  }
135
139
  .tds-accordion-item[disabled=true]:focus-visible {
136
140
  border-color: var(--tds-accordion-border);
@@ -37,6 +37,14 @@
37
37
  .card .card-header.below {
38
38
  padding-top: 16px;
39
39
  }
40
+ .card .card-header.expandable tds-icon {
41
+ cursor: pointer;
42
+ margin-left: auto;
43
+ transition: transform 160ms ease-in-out, opacity 120ms ease-in-out;
44
+ }
45
+ .card .card-header.expandable tds-icon.rotated {
46
+ transform: rotate(180deg);
47
+ }
40
48
  .card .header-subheader {
41
49
  display: flex;
42
50
  flex-direction: column;
@@ -115,4 +123,8 @@ button:active {
115
123
  .above-header-stretch .card-body slot[name=body]::slotted(*) {
116
124
  max-width: unset;
117
125
  flex-grow: 1;
126
+ }
127
+
128
+ :host([expandable]:not([expanded])) .card-body slot[name=body] {
129
+ display: none;
118
130
  }
@@ -11,6 +11,11 @@ import hasSlot from "../../utils/hasSlot";
11
11
  */
12
12
  export class TdsCard {
13
13
  constructor() {
14
+ this.toggleExpand = () => {
15
+ if (this.expandable) {
16
+ this.expanded = !this.expanded;
17
+ }
18
+ };
14
19
  this.handleClick = () => {
15
20
  this.tdsClick.emit({
16
21
  cardId: this.cardId,
@@ -20,7 +25,7 @@ export class TdsCard {
20
25
  const usesHeaderSlot = hasSlot('header', this.host);
21
26
  const usesSubheaderSlot = hasSlot('subheader', this.host);
22
27
  const usesThumbnailSlot = hasSlot('thumbnail', this.host);
23
- return (h("div", { class: "card-header" }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader", id: `header-${this.cardId}` }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" }))));
28
+ return (h("div", { class: { 'card-header': true, 'expandable': this.expandable, 'expanded': this.expanded } }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader", id: `header-${this.cardId}` }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" })), this.expandable && (h("tds-button", { type: "button", variant: "ghost", size: "sm", "tds-aria-label": "Toggle card content", "aria-expanded": this.expanded ? 'true' : 'false', onClick: this.toggleExpand }, h("tds-icon", { slot: "icon", size: "16px", name: "chevron_down", svgTitle: "Chevron Down", class: { rotated: this.expanded } })))));
24
29
  };
25
30
  this.getCardContent = () => {
26
31
  const usesBodySlot = hasSlot('body', this.host);
@@ -39,6 +44,8 @@ export class TdsCard {
39
44
  this.clickable = false;
40
45
  this.stretch = false;
41
46
  this.cardId = generateUniqueId();
47
+ this.expandable = false;
48
+ this.expanded = false;
42
49
  }
43
50
  render() {
44
51
  const cardStyle = {
@@ -48,7 +55,7 @@ export class TdsCard {
48
55
  [`${this.imagePlacement}-stretch`]: this.stretch,
49
56
  };
50
57
  const ariaLabel = this.header ? this.header : `Card ${this.cardId}`;
51
- return (h(Host, { key: '39dde374a44320884af4b8a0da33e24c983417c5', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: this.handleClick, "aria-label": ariaLabel, "aria-describedby": `header-${this.cardId}` }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
58
+ return (h(Host, { key: '14e4d2ece54e021a186661c8dfef2dae78791782', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: this.handleClick, "aria-label": ariaLabel, "aria-describedby": `header-${this.cardId}` }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
52
59
  }
53
60
  static get is() { return "tds-card"; }
54
61
  static get encapsulation() { return "shadow"; }
@@ -239,6 +246,42 @@ export class TdsCard {
239
246
  "attribute": "card-id",
240
247
  "reflect": false,
241
248
  "defaultValue": "generateUniqueId()"
249
+ },
250
+ "expandable": {
251
+ "type": "boolean",
252
+ "mutable": false,
253
+ "complexType": {
254
+ "original": "boolean",
255
+ "resolved": "boolean",
256
+ "references": {}
257
+ },
258
+ "required": false,
259
+ "optional": false,
260
+ "docs": {
261
+ "tags": [],
262
+ "text": "Enables expandable behaviour.\nWhen true, clicking the header toggles content visibility."
263
+ },
264
+ "attribute": "expandable",
265
+ "reflect": false,
266
+ "defaultValue": "false"
267
+ },
268
+ "expanded": {
269
+ "type": "boolean",
270
+ "mutable": true,
271
+ "complexType": {
272
+ "original": "boolean",
273
+ "resolved": "boolean",
274
+ "references": {}
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "Tracks the current expanded state when expandable is enabled."
281
+ },
282
+ "attribute": "expanded",
283
+ "reflect": true,
284
+ "defaultValue": "false"
242
285
  }
243
286
  };
244
287
  }
@@ -57,10 +57,18 @@ export class TdsDropdownOption {
57
57
  }
58
58
  };
59
59
  this.handleFocus = (event) => {
60
- this.tdsFocus.emit(event);
60
+ // Focus events are now handled by the parent dropdown component
61
+ // Only emit if this is a standalone option (not within a dropdown)
62
+ if (!this.parentElement) {
63
+ this.tdsFocus.emit(event);
64
+ }
61
65
  };
62
66
  this.handleBlur = (event) => {
63
- this.tdsBlur.emit(event);
67
+ // Blur events are now handled by the parent dropdown component
68
+ // Only emit if this is a standalone option (not within a dropdown)
69
+ if (!this.parentElement) {
70
+ this.tdsBlur.emit(event);
71
+ }
64
72
  };
65
73
  this.value = undefined;
66
74
  this.internalValue = undefined;
@@ -81,7 +89,7 @@ export class TdsDropdownOption {
81
89
  this.internalValue = convertToString(this.value);
82
90
  }
83
91
  render() {
84
- return (h(Host, { key: 'd35a3153be292b1656d0efca93f06bfc1357041b' }, h("div", { key: '384353f9868a3fb559ca4140d5cd4f5553e024ad', class: `dropdown-option
92
+ return (h(Host, { key: '5448be3efbb06ae6d0fa3797f4b724c2d656d7a3' }, h("div", { key: '78945300c0bddb4ce95ab6f8de50eded1383dec7', class: `dropdown-option
85
93
  ${this.size}
86
94
  ${this.selected ? 'selected' : ''}
87
95
  ${this.disabled ? 'disabled' : ''}
@@ -91,6 +99,8 @@ export class TdsDropdownOption {
91
99
  }
92
100
  } }, h("tds-checkbox", { onTdsChange: (event) => {
93
101
  this.handleMultiselect(event);
102
+ }, onTdsBlur: (event) => {
103
+ event.stopPropagation();
94
104
  }, disabled: this.disabled, checked: this.selected, tdsAriaLabel: this.tdsAriaLabel, class: {
95
105
  [this.size]: true,
96
106
  } }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, "aria-label": this.tdsAriaLabel, onClick: () => {
@@ -14,6 +14,7 @@ function hasValueChanged(newValue, currentValue) {
14
14
  */
15
15
  export class TdsDropdown {
16
16
  constructor() {
17
+ this.hasFocus = false;
17
18
  this.setDefaultOption = () => {
18
19
  if (this.internalDefaultValue) {
19
20
  // Convert the internal default value to an array if it's not already
@@ -96,6 +97,7 @@ export class TdsDropdown {
96
97
  this.handleFilter = (event) => {
97
98
  this.tdsInput.emit(event);
98
99
  const query = event.target.value.toLowerCase();
100
+ this.filterQuery = query;
99
101
  /* Check if the query is empty, and if so, show all options */
100
102
  const children = this.getChildren();
101
103
  if (query === '') {
@@ -121,26 +123,33 @@ export class TdsDropdown {
121
123
  }
122
124
  };
123
125
  this.handleFilterReset = () => {
124
- this.reset();
126
+ // only reset selected values when filterquery is blank
127
+ if (!this.filterQuery.length) {
128
+ this.reset();
129
+ }
125
130
  this.inputElement.value = '';
126
131
  this.handleFilter({ target: { value: '' } });
127
132
  this.inputElement.focus();
128
133
  // Add this line to ensure internal value is cleared
129
134
  this.internalValue = '';
130
135
  };
131
- this.handleFocus = (event) => {
136
+ this.handleFocus = () => {
132
137
  this.open = true;
133
138
  this.filterFocus = true;
134
- if (this.multiselect && this.inputElement) {
139
+ if (this.inputElement) {
135
140
  this.inputElement.value = '';
136
141
  }
137
- this.tdsFocus.emit(event);
142
+ // Focus event is now handled by focusin listener
138
143
  if (this.filter) {
139
144
  this.handleFilter({ target: { value: '' } });
140
145
  }
141
146
  };
142
- this.handleBlur = (event) => {
143
- this.tdsBlur.emit(event);
147
+ this.handleBlur = () => {
148
+ // Handle internal state changes when component loses focus
149
+ this.filterFocus = false;
150
+ if (this.inputElement) {
151
+ this.inputElement.value = this.getValue();
152
+ }
144
153
  };
145
154
  this.resetInput = () => {
146
155
  const inputEl = this.host.querySelector('input');
@@ -172,6 +181,7 @@ export class TdsDropdown {
172
181
  this.filterFocus = undefined;
173
182
  this.internalDefaultValue = undefined;
174
183
  this.selectedOptions = [];
184
+ this.filterQuery = '';
175
185
  }
176
186
  handleValueChange(newValue) {
177
187
  // Normalize to array
@@ -315,7 +325,7 @@ export class TdsDropdown {
315
325
  }
316
326
  }
317
327
  // Always trigger the focus event to open the dropdown
318
- this.handleFocus({});
328
+ this.handleFocus();
319
329
  }
320
330
  /** Method for closing the Dropdown. */
321
331
  async close() {
@@ -337,6 +347,25 @@ export class TdsDropdown {
337
347
  }
338
348
  }
339
349
  }
350
+ onFocusIn(event) {
351
+ // Check if the focus is within this dropdown component
352
+ if (this.host.contains(event.target)) {
353
+ if (!this.hasFocus) {
354
+ this.hasFocus = true;
355
+ this.tdsFocus.emit(event);
356
+ }
357
+ }
358
+ }
359
+ onFocusOut(event) {
360
+ // Only emit blur if focus is actually leaving the entire dropdown component
361
+ const relatedTarget = event.relatedTarget;
362
+ // If relatedTarget is null (focus going to body/window) or outside the component, emit blur
363
+ if (this.hasFocus && (!relatedTarget || !this.host.contains(relatedTarget))) {
364
+ this.hasFocus = false;
365
+ this.handleBlur();
366
+ this.tdsBlur.emit(event);
367
+ }
368
+ }
340
369
  async onKeyDown(event) {
341
370
  var _a;
342
371
  // Get the active element
@@ -456,9 +485,9 @@ export class TdsDropdown {
456
485
  // Generate unique IDs for associating labels and helpers with the input/button
457
486
  const labelId = this.label ? `dropdown-label-${this.name || generateUniqueId()}` : undefined;
458
487
  const helperId = this.helper ? `dropdown-helper-${this.name || generateUniqueId()}` : undefined;
459
- return (h(Host, { key: '69cdc96b6983b9556b4a9133ef8a0d2fa1e9e18e', class: {
488
+ return (h(Host, { key: '66323582950b2ac2a9e15cbcde747ab377af8c4b', class: {
460
489
  [`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
461
- } }, this.label && this.labelPosition === 'outside' && (h("div", { key: '1cc3f825bc81ca34af7bbe845bd900531f724172', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '213f3149de4b9bc4c147ab658d6d5199d3360181', class: {
490
+ } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'f931805898336e462f931705f6d6b7bec8b2516a', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '56097022f7ae2d0a5501ab0dfbf1f802d3c5802f', class: {
462
491
  'dropdown-select': true,
463
492
  [this.size]: true,
464
493
  'disabled': this.disabled,
@@ -475,13 +504,7 @@ export class TdsDropdown {
475
504
  // eslint-disable-next-line no-return-assign
476
505
  ref: (inputEl) => (this.inputElement = inputEl), class: {
477
506
  placeholder: this.labelPosition === 'inside',
478
- }, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
479
- this.filterFocus = false;
480
- if (this.multiselect) {
481
- this.inputElement.value = this.getValue();
482
- }
483
- this.handleBlur(event);
484
- }, onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => {
507
+ }, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? this.filterQuery : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onFocus: () => this.handleFocus(), onKeyDown: (event) => {
485
508
  if (event.key === 'Escape') {
486
509
  this.open = false;
487
510
  }
@@ -508,7 +531,7 @@ export class TdsDropdown {
508
531
  label-inside-as-placeholder
509
532
  ${this.size}
510
533
  ${this.selectedOptions.length ? 'selected' : ''}
511
- ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: 'af7815b0cb8b36e37278965094d5198a9ff5aba9', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
534
+ ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '165c4d884bd364ecbbc61f071e1302a31213b538', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
512
535
  this.dropdownList = element;
513
536
  }, class: {
514
537
  'dropdown-list': true,
@@ -519,11 +542,11 @@ export class TdsDropdown {
519
542
  'closed': !this.open,
520
543
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
521
544
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
522
- } }, h("slot", { key: '736b82b5f716fa818c17ae161341bc6b131d9cf2', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'f1c1471cbec4a6dd8830a8540f54e142c559d539', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'aa138a349c073158785ae1177c0879604f6b8d90', id: helperId, class: {
545
+ } }, h("slot", { key: '3ad8c4742a8f8a8483769be189042b557ed7a37c', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '71918f0b750cf920246034a19444f6e694333031', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'ce6219f445aa2282ef31434b8a363c62c635d347', id: helperId, class: {
523
546
  helper: true,
524
547
  error: this.error,
525
548
  disabled: this.disabled,
526
- } }, this.error && h("tds-icon", { key: '936a8bd7db8a0ed994d6827c26bbb6732420fea4', name: "error", size: "16px" }), this.helper))));
549
+ } }, this.error && h("tds-icon", { key: '1868cc5a58e787aa686754cea80b1a9b3b1f3a82', name: "error", size: "16px" }), this.helper))));
527
550
  }
528
551
  static get is() { return "tds-dropdown"; }
529
552
  static get encapsulation() { return "shadow"; }
@@ -865,7 +888,8 @@ export class TdsDropdown {
865
888
  "filterResult": {},
866
889
  "filterFocus": {},
867
890
  "internalDefaultValue": {},
868
- "selectedOptions": {}
891
+ "selectedOptions": {},
892
+ "filterQuery": {}
869
893
  };
870
894
  }
871
895
  static get events() {
@@ -1112,6 +1136,18 @@ export class TdsDropdown {
1112
1136
  "target": "window",
1113
1137
  "capture": false,
1114
1138
  "passive": true
1139
+ }, {
1140
+ "name": "focusin",
1141
+ "method": "onFocusIn",
1142
+ "target": undefined,
1143
+ "capture": false,
1144
+ "passive": false
1145
+ }, {
1146
+ "name": "focusout",
1147
+ "method": "onFocusOut",
1148
+ "target": undefined,
1149
+ "capture": false,
1150
+ "passive": false
1115
1151
  }, {
1116
1152
  "name": "keydown",
1117
1153
  "method": "onKeyDown",
@@ -22,10 +22,10 @@
22
22
  }
23
23
  :host ::slotted(button:focus-visible),
24
24
  :host ::slotted(a:focus-visible) {
25
+ border: none;
25
26
  outline: 2px solid var(--tds-focus-outline-color);
26
- box-shadow: 0 0 0 1px var(--tds-white);
27
- outline-offset: 1px;
28
- z-index: 1;
27
+ box-shadow: inset 0 0 0 3px var(--tds-white);
28
+ outline-offset: -2px;
29
29
  }
30
30
  :host .component-active ::slotted(button),
31
31
  :host .component-active ::slotted(a) {
@@ -8,22 +8,28 @@
8
8
  color: var(--tds-link);
9
9
  text-decoration: underline;
10
10
  }
11
+ :host ::slotted(*:hover) {
12
+ color: var(--tds-link-hover);
13
+ text-decoration: none;
14
+ }
15
+ :host .no-underline ::slotted(*) {
16
+ text-decoration: none;
17
+ }
18
+ :host .no-underline ::slotted(*:hover) {
19
+ color: var(--tds-link-hover);
20
+ text-decoration: underline;
21
+ text-decoration-color: var(--tds-link-hover);
22
+ }
11
23
  :host ::slotted(*:focus-visible) {
12
24
  color: var(--tds-link-focus);
13
25
  text-decoration: none;
14
- outline: 2px solid var(--tds-link-focus);
15
- outline-offset: -2px;
26
+ box-shadow: 0 0 0 1px var(--tds-white), 0 0 0 3px var(--tds-link-focus);
16
27
  }
17
28
  :host ::slotted(*:active) {
18
29
  color: var(--tds-link);
19
30
  text-decoration: underline;
20
31
  text-decoration-color: var(--tds-link);
21
32
  }
22
- :host ::slotted(*:hover) {
23
- color: var(--tds-link-hover);
24
- text-decoration: underline;
25
- text-decoration-color: var(--tds-link-hover);
26
- }
27
33
  :host ::slotted(*:visited) {
28
34
  color: var(--tds-link-visited);
29
35
  text-decoration-color: var(--tds-link-visited);
@@ -36,14 +42,6 @@
36
42
  pointer-events: none;
37
43
  }
38
44
 
39
- .no-underline ::slotted(*) {
40
- text-decoration: none;
41
- }
42
-
43
- .no-underline:hover ::slotted(*) {
44
- text-decoration: none;
45
- }
46
-
47
45
  .standalone ::slotted(*) {
48
46
  font: var(--tds-detail-02);
49
47
  letter-spacing: var(--tds-detail-02-ls);
@@ -3,7 +3,7 @@
3
3
  display: inline-block;
4
4
  color: var(--tds-popover-canvas-color);
5
5
  background-color: var(--tds-popover-canvas-background);
6
- box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);
6
+ box-shadow: var(--tds-popover-canvas-box-shadow);
7
7
  border-radius: 4px;
8
8
  z-index: 900;
9
9
  }
@@ -16,6 +16,7 @@ export class TdsPopoverCanvas {
16
16
  this.offsetDistance = 8;
17
17
  this.modifiers = [];
18
18
  this.tdsAlertDialog = 'dialog';
19
+ this.modeVariant = null;
19
20
  this.childRef = undefined;
20
21
  }
21
22
  /** Property for closing popover programmatically */
@@ -28,12 +29,14 @@ export class TdsPopoverCanvas {
28
29
  }
29
30
  render() {
30
31
  var _a;
31
- return (h(Host, { key: '58db11b606cb1211fc569e0868a602ed935b46fa' }, h("tds-popover-core", Object.assign({ key: 'be884f4ea53cbb76e2c07cd87fba10c66cb18618', role: this.tdsAlertDialog }, this.inheritedAttributes, { class: {
32
+ return (h(Host, { key: '007d1ad318e2819ca95b3f855540308527e9bea4', class: {
33
+ [`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
34
+ } }, h("tds-popover-core", Object.assign({ key: '3d2c887c763dec9f93cc943a29d108ec4708df25', role: this.tdsAlertDialog }, this.inheritedAttributes, { class: {
32
35
  'tds-popover-canvas': true,
33
36
  [(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
34
37
  }, 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) => {
35
38
  this.childRef = el;
36
- }, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: 'b7436bdce7bb19745ac25dfc5a9db16f308db41c' }, h("slot", { key: '6436d57046cde0d03359899690be4af1b17fe506' })))));
39
+ }, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: 'b16b226f5b748403ce4a20e2e289b7fb0d0e3554' }, h("slot", { key: 'ecdee2eaebdd35bb0ef634b8a0ef9bbf8e1a3fc7' })))));
37
40
  }
38
41
  static get is() { return "tds-popover-canvas"; }
39
42
  static get encapsulation() { return "scoped"; }
@@ -204,14 +207,9 @@ export class TdsPopoverCanvas {
204
207
  "type": "unknown",
205
208
  "mutable": false,
206
209
  "complexType": {
207
- "original": "Object[]",
208
- "resolved": "Object[]",
209
- "references": {
210
- "Object": {
211
- "location": "global",
212
- "id": "global::Object"
213
- }
214
- }
210
+ "original": "object[]",
211
+ "resolved": "object[]",
212
+ "references": {}
215
213
  },
216
214
  "required": false,
217
215
  "optional": false,
@@ -238,6 +236,24 @@ export class TdsPopoverCanvas {
238
236
  "attribute": "tds-alert-dialog",
239
237
  "reflect": false,
240
238
  "defaultValue": "'dialog'"
239
+ },
240
+ "modeVariant": {
241
+ "type": "string",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "'primary' | 'secondary'",
245
+ "resolved": "\"primary\" | \"secondary\"",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Mode variant of the component, based on current mode."
253
+ },
254
+ "attribute": "mode-variant",
255
+ "reflect": false,
256
+ "defaultValue": "null"
241
257
  }
242
258
  };
243
259
  }
@@ -28,14 +28,12 @@ export class TdsSideMenuCollapseButton {
28
28
  this.collapsed = this.sideMenuEl.collapsed;
29
29
  }
30
30
  render() {
31
- return (h(Host, { key: 'fecd00dc0ef2ce899b82ce304034b5b6f75704ed', role: "button", tabindex: "0", "aria-expanded": !this.collapsed ? 'true' : 'false', onClick: () => {
32
- this.handleClick();
33
- } }, h("div", { key: '6d7ae7bd95d8c4c37895d06ce8d4eaebe08e91dd', class: {
31
+ return (h(Host, { key: '71376a20166f28551ed139362144a79a20e35213' }, h("div", { key: 'a68ff13ee66ff8866f41bd36dbd5f2a38408ed6c', class: {
34
32
  'wrapper': true,
35
33
  'state-collapsed': this.collapsed,
36
- } }, h("tds-side-menu-item", { key: '2cc8087248c6f9eee7943039092c5a45f9c2376d', class: {
37
- button: true,
38
- } }, h("a", { key: 'e2510c1f475b5f6ff3d1de367360fc2e34e0c0c0' }, h("svg", { key: '7ea54a6bcfb144cab3045fb34316eac400c59e43', class: "icon", slot: "icon", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '3db930370416d9906ccdf821e6d43d0e6633534a', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 1.975a1 1 0 0 1 1 1v20.3l9.311-9.312a1 1 0 0 1 1.415 1.414l-9.887 9.887a2.6 2.6 0 0 1-3.677 0l-9.887-9.887a1 1 0 1 1 1.414-1.414L15 23.274V2.975a1 1 0 0 1 1-1ZM5.188 28.001a1 1 0 0 0 0 2h21.62a1 1 0 1 0 0-2H5.188Z", fill: "currentColor" })), !this.collapsed && h("slot", { key: '7fba28f202ca8089ffce93c051c8d6afc23afef7' }))))));
34
+ } }, h("tds-side-menu-item", { key: '087dae21fe6c6f7f0bb7065d5b8ea4ab1f94a759', class: { button: true } }, h("button", { key: 'fd2202b8a038728b756978fac15eaff80f425d25', type: "button", "aria-expanded": !this.collapsed ? 'true' : 'false', onClick: () => {
35
+ this.handleClick();
36
+ } }, h("svg", { key: '35c741c7fc3a9d009313cb16f6d656033f757b2f', class: "icon", slot: "icon", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: 'e9b567c3137eef6b8b309cea7606ebae227ebdf9', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 1.975a1 1 0 0 1 1 1v20.3l9.311-9.312a1 1 0 0 1 1.415 1.414l-9.887 9.887a2.6 2.6 0 0 1-3.677 0l-9.887-9.887a1 1 0 1 1 1.414-1.414L15 23.274V2.975a1 1 0 0 1 1-1ZM5.188 28.001a1 1 0 0 0 0 2h21.62a1 1 0 1 0 0-2H5.188Z", fill: "currentColor" })), !this.collapsed && h("slot", { key: 'b6af5dcd3554623803af3d88243eeeef573e20aa' }))))));
39
37
  }
40
38
  static get is() { return "tds-side-menu-collapse-button"; }
41
39
  static get encapsulation() { return "shadow"; }
@@ -26,24 +26,102 @@
26
26
  }
27
27
  :host .component ::slotted(a:hover),
28
28
  :host .component ::slotted(button:hover) {
29
- background-color: var(--tds-header-nav-item-dropdown-opened-background-hover);
29
+ background-color: var(--tds-sidebar-item-state-hover);
30
30
  cursor: pointer;
31
+ position: relative;
32
+ }
33
+ :host .component ::slotted(a:hover)::before,
34
+ :host .component ::slotted(button:hover)::before {
35
+ content: "";
36
+ position: absolute;
37
+ top: 0;
38
+ left: 0;
39
+ width: 4px;
40
+ height: 100%;
41
+ background-color: var(--tds-side-menu-item-hover-indicator);
42
+ }
43
+ :host .component ::slotted(a:hover:focus-visible),
44
+ :host .component ::slotted(button:hover:focus-visible) {
45
+ background-color: var(--tds-sidebar-item-state-hover);
46
+ cursor: pointer;
47
+ position: relative;
48
+ }
49
+ :host .component ::slotted(a:hover:focus-visible)::before,
50
+ :host .component ::slotted(button:hover:focus-visible)::before {
51
+ content: "";
52
+ position: absolute;
53
+ top: 3px;
54
+ left: 3px;
55
+ width: 4px;
56
+ height: calc(100% - 6px);
57
+ background-color: var(--tds-side-menu-item-hover-indicator);
31
58
  }
32
59
  :host .component ::slotted(a:active),
33
60
  :host .component ::slotted(button:active) {
34
- background-color: var(--tds-header-nav-item-dropdown-opened-background-active) !important;
61
+ background-color: var(--tds-sidemenu-item-state-active) !important;
35
62
  cursor: pointer;
63
+ position: relative;
64
+ }
65
+ :host .component ::slotted(a:active)::before,
66
+ :host .component ::slotted(button:active)::before {
67
+ content: "";
68
+ position: absolute;
69
+ top: 0;
70
+ left: 0;
71
+ width: 4px;
72
+ height: 100%;
73
+ background-color: var(--tds-side-menu-item-pressed-indicator);
74
+ }
75
+ :host .component ::slotted(a:active:focus-visible),
76
+ :host .component ::slotted(button:active:focus-visible) {
77
+ background-color: var(--tds-sidemenu-item-state-active) !important;
78
+ cursor: pointer;
79
+ position: relative;
80
+ }
81
+ :host .component ::slotted(a:active:focus-visible)::before,
82
+ :host .component ::slotted(button:active:focus-visible)::before {
83
+ content: "";
84
+ position: absolute;
85
+ top: 3px;
86
+ left: 3px;
87
+ width: 4px;
88
+ height: calc(100% - 6px);
89
+ background-color: var(--tds-side-menu-item-pressed-indicator);
36
90
  }
37
91
  :host .component ::slotted(a:focus-visible) {
38
92
  outline: 2px solid var(--tds-focus-outline-color);
39
- box-shadow: 0 0 0 1px var(--tds-white);
40
- outline-offset: 1px;
41
- z-index: 1;
93
+ box-shadow: inset 0 0 0 3px var(--tds-white);
94
+ outline-offset: -2px;
42
95
  }
43
96
  :host .component.component-selected ::slotted(a),
44
97
  :host .component.component-selected ::slotted(button) {
45
- box-shadow: inset 4px 0 0 var(--tds-nav-item-border-color-active);
46
98
  background-color: var(--tds-header-nav-item-dropdown-opened-background-selected);
99
+ position: relative;
100
+ }
101
+ :host .component.component-selected ::slotted(a)::before,
102
+ :host .component.component-selected ::slotted(button)::before {
103
+ content: "";
104
+ position: absolute;
105
+ top: 0;
106
+ left: 0;
107
+ width: 4px;
108
+ height: 100%;
109
+ background-color: var(--tds-sidebar-side-menu-single-subitem-selected-border-color);
110
+ }
111
+ :host .component.component-selected ::slotted(a:focus-visible),
112
+ :host .component.component-selected ::slotted(button:focus-visible) {
113
+ background-color: var(--tds-header-nav-item-dropdown-opened-background-selected);
114
+ position: relative;
115
+ }
116
+ :host .component.component-selected ::slotted(a:focus-visible)::before,
117
+ :host .component.component-selected ::slotted(button:focus-visible)::before {
118
+ content: "";
119
+ position: absolute;
120
+ top: 3px;
121
+ left: 3px;
122
+ width: 4px;
123
+ height: calc(100% - 6px);
124
+ background-color: var(--tds-sidebar-side-menu-single-subitem-selected-border-color);
47
125
  }
48
126
  :host .component.component-dropdown-has-icon:not(.component-collapsed) ::slotted(a),
49
127
  :host .component.component-dropdown-has-icon:not(.component-collapsed) ::slotted(button) {