@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
@@ -43,17 +43,76 @@
43
43
  :host .component ::slotted(a:focus-visible),
44
44
  :host .component ::slotted(button:focus-visible) {
45
45
  outline: 2px solid var(--tds-focus-outline-color);
46
- box-shadow: 0 0 0 1px var(--tds-white);
47
- outline-offset: 1px;
48
- z-index: 1;
46
+ box-shadow: inset 0 0 0 3px var(--tds-white);
47
+ outline-offset: -2px;
49
48
  }
50
49
  :host .component:hover ::slotted(a),
51
- :host .component:hover ::slotted(button) {
50
+ :host .component:hover ::slotted(button),
51
+ :host .component:hover ::slotted(tds-side-menu-user) {
52
52
  background-color: var(--tds-sidebar-item-state-hover);
53
+ position: relative;
54
+ }
55
+ :host .component:hover ::slotted(a)::before,
56
+ :host .component:hover ::slotted(button)::before,
57
+ :host .component:hover ::slotted(tds-side-menu-user)::before {
58
+ content: "";
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ width: 4px;
63
+ height: 100%;
64
+ background-color: var(--tds-side-menu-item-hover-indicator);
65
+ }
66
+ :host .component:hover ::slotted(a:focus-visible),
67
+ :host .component:hover ::slotted(button:focus-visible),
68
+ :host .component:hover ::slotted(tds-side-menu-user:focus-visible) {
69
+ background-color: var(--tds-sidebar-item-state-hover);
70
+ position: relative;
71
+ }
72
+ :host .component:hover ::slotted(a:focus-visible)::before,
73
+ :host .component:hover ::slotted(button:focus-visible)::before,
74
+ :host .component:hover ::slotted(tds-side-menu-user:focus-visible)::before {
75
+ content: "";
76
+ position: absolute;
77
+ top: 3px;
78
+ left: 3px;
79
+ width: 4px;
80
+ height: calc(100% - 6px);
81
+ background-color: var(--tds-side-menu-item-hover-indicator);
53
82
  }
54
83
  :host .component:active ::slotted(a),
55
- :host .component:active ::slotted(button) {
84
+ :host .component:active ::slotted(button),
85
+ :host .component:active ::slotted(tds-side-menu-user) {
86
+ background-color: var(--tds-sidemenu-item-state-active);
87
+ position: relative;
88
+ }
89
+ :host .component:active ::slotted(a)::before,
90
+ :host .component:active ::slotted(button)::before,
91
+ :host .component:active ::slotted(tds-side-menu-user)::before {
92
+ content: "";
93
+ position: absolute;
94
+ top: 0;
95
+ left: 0;
96
+ width: 4px;
97
+ height: 100%;
98
+ background-color: var(--tds-side-menu-item-pressed-indicator);
99
+ }
100
+ :host .component:active ::slotted(a:focus-visible),
101
+ :host .component:active ::slotted(button:focus-visible),
102
+ :host .component:active ::slotted(tds-side-menu-user:focus-visible) {
56
103
  background-color: var(--tds-sidemenu-item-state-active);
104
+ position: relative;
105
+ }
106
+ :host .component:active ::slotted(a:focus-visible)::before,
107
+ :host .component:active ::slotted(button:focus-visible)::before,
108
+ :host .component:active ::slotted(tds-side-menu-user:focus-visible)::before {
109
+ content: "";
110
+ position: absolute;
111
+ top: 3px;
112
+ left: 3px;
113
+ width: 4px;
114
+ height: calc(100% - 6px);
115
+ background-color: var(--tds-side-menu-item-pressed-indicator);
57
116
  }
58
117
  :host .component-collapsed ::slotted(a),
59
118
  :host .component-collapsed ::slotted(button) {
@@ -66,8 +125,8 @@
66
125
  :host .component-selected:not(:host .component-active) ::slotted(a),
67
126
  :host .component-selected:not(:host .component-active) ::slotted(button),
68
127
  :host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user) {
69
- position: relative;
70
128
  background-color: var(--tds-sidebar-item-state-selected);
129
+ position: relative;
71
130
  }
72
131
  :host .component-selected:not(:host .component-active) ::slotted(a)::before,
73
132
  :host .component-selected:not(:host .component-active) ::slotted(button)::before,
@@ -80,6 +139,23 @@
80
139
  height: 100%;
81
140
  background-color: var(--tds-sidebar-side-menu-single-subitem-selected-border-color);
82
141
  }
142
+ :host .component-selected:not(:host .component-active) ::slotted(a:focus-visible),
143
+ :host .component-selected:not(:host .component-active) ::slotted(button:focus-visible),
144
+ :host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user:focus-visible) {
145
+ background-color: var(--tds-sidebar-item-state-selected);
146
+ position: relative;
147
+ }
148
+ :host .component-selected:not(:host .component-active) ::slotted(a:focus-visible)::before,
149
+ :host .component-selected:not(:host .component-active) ::slotted(button:focus-visible)::before,
150
+ :host .component-selected:not(:host .component-active) ::slotted(tds-side-menu-user:focus-visible)::before {
151
+ content: "";
152
+ position: absolute;
153
+ top: 3px;
154
+ left: 3px;
155
+ width: 4px;
156
+ height: calc(100% - 6px);
157
+ background-color: var(--tds-sidebar-side-menu-single-subitem-selected-border-color);
158
+ }
83
159
 
84
160
  @media (min-width: 992px) {
85
161
  :host .component.component-collapsed ::slotted(a),
@@ -27,12 +27,6 @@ tds-slider .sr-only {
27
27
  pointer-events: none;
28
28
  }
29
29
 
30
- .tds-slider-wrapper:focus-within {
31
- outline: 2px solid var(--tds-blue-400);
32
- outline-offset: 2px;
33
- border-radius: var(--tds-spacing-element-4);
34
- }
35
-
36
30
  .tds-slider {
37
31
  width: 100%;
38
32
  display: flex;
@@ -44,6 +38,12 @@ tds-slider .sr-only {
44
38
  height: 20px;
45
39
  position: relative;
46
40
  }
41
+ .tds-slider .tds-slider-inner:focus-within .tds-slider__thumb-inner {
42
+ outline: var(--tds-slider-thumb-focus-outline);
43
+ box-shadow: var(--tds-slider-thumb-focus-box-shadow);
44
+ outline-offset: var(--tds-slider-thumb-focus-outline-offset);
45
+ z-index: 1;
46
+ }
47
47
  .tds-slider .tds-slider__controls {
48
48
  position: relative;
49
49
  top: -25px;
@@ -81,30 +81,23 @@ tds-slider .sr-only {
81
81
  justify-content: center;
82
82
  border-radius: 4px 4px 0 0;
83
83
  }
84
- .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field {
85
- font: var(--tds-detail-02);
86
- letter-spacing: var(--tds-detail-02-ls);
87
- color: var(--tds-slider-inputfield-number-color);
88
- border: 0;
89
- background-color: transparent;
90
- text-align: center;
84
+ .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number] {
85
+ width: auto;
91
86
  padding: 12px;
92
- box-shadow: inset 0 -1px 0 var(--tds-slider-inputfield-box-shadow);
93
- border-radius: 4px 4px 0 0;
87
+ text-align: center;
94
88
  appearance: textfield;
95
89
  }
96
- .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field:hover {
97
- box-shadow: inset 0 -1px 0 var(--tds-grey-600);
98
- }
99
- .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field:focus {
100
- box-shadow: inset 0 -2px 0 var(--tds-blue-400);
101
- outline: 0;
102
- }
103
- .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field::-webkit-outer-spin-button,
104
- .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper input.tds-slider__input-field::-webkit-inner-spin-button {
90
+ .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number]::-webkit-outer-spin-button,
91
+ .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input[type=number]::-webkit-inner-spin-button {
105
92
  appearance: none;
106
93
  margin: 0;
107
94
  }
95
+ .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-input:read-only {
96
+ text-align: left;
97
+ }
98
+ .tds-slider .tds-slider__input-values .tds-slider__input-field-wrapper tds-text-field .text-field-icon__readonly {
99
+ right: 12px;
100
+ }
108
101
  .tds-slider label {
109
102
  font: var(--tds-detail-05);
110
103
  letter-spacing: var(--tds-detail-05-ls);
@@ -122,7 +115,7 @@ tds-slider .sr-only {
122
115
  letter-spacing: var(--tds-detail-01-ls);
123
116
  user-select: none;
124
117
  border-radius: 4px;
125
- padding: 8px;
118
+ padding: 8px 11px;
126
119
  position: absolute;
127
120
  transform: translate(-50%, -100%);
128
121
  top: -24px;
@@ -139,6 +132,9 @@ tds-slider .sr-only {
139
132
  .tds-slider .tds-slider__thumb {
140
133
  position: absolute;
141
134
  }
135
+ .tds-slider .tds-slider__thumb:hover .tds-slider__value {
136
+ display: block;
137
+ }
142
138
  .tds-slider .tds-slider__thumb .tds-slider__thumb-inner {
143
139
  width: 20px;
144
140
  height: 20px;
@@ -164,7 +160,7 @@ tds-slider .sr-only {
164
160
  }
165
161
  .tds-slider .tds-slider__thumb .tds-slider__thumb-inner:hover::before {
166
162
  display: block;
167
- opacity: 0.08;
163
+ background-color: var(--tds-slider-thumb-hover);
168
164
  }
169
165
  .tds-slider .tds-slider__thumb .tds-slider__thumb-inner.pressed {
170
166
  width: 24px;
@@ -172,7 +168,7 @@ tds-slider .sr-only {
172
168
  }
173
169
  .tds-slider .tds-slider__thumb .tds-slider__thumb-inner.pressed::before {
174
170
  display: block;
175
- opacity: 0.16 !important;
171
+ background-color: var(--tds-slider-thumb-pressed);
176
172
  }
177
173
  .tds-slider .tds-slider__value-dividers-wrapper {
178
174
  position: relative;
@@ -307,7 +303,7 @@ tds-slider .sr-only {
307
303
  }
308
304
 
309
305
  .tds-slider .tds-slider__controls .tds-slider__control {
310
- cursor: default;
306
+ cursor: pointer;
311
307
  }
312
308
  .tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-minus tds-icon, .tds-slider .tds-slider__controls .tds-slider__control.tds-slider__control-plus tds-icon {
313
309
  color: var(--tds-slider-controls-color);
@@ -267,6 +267,25 @@ export class TdsSlider {
267
267
  const rounded = this.roundToStep(newValue);
268
268
  this.forceValueUpdate(rounded.toString());
269
269
  }
270
+ /** Updates the slider value when using tds-text-field (reads value from host element) */
271
+ updateSliderValueFromTextField(event) {
272
+ const hostEl = event.target; // tds-text-field host element exposes a value prop
273
+ const raw = hostEl && typeof hostEl.value !== 'undefined' ? hostEl.value : '';
274
+ let newValue = parseFloat(raw);
275
+ if (Number.isNaN(newValue)) {
276
+ return;
277
+ }
278
+ const minNum = parseFloat(this.min);
279
+ const maxNum = parseFloat(this.max);
280
+ if (newValue < minNum) {
281
+ newValue = minNum;
282
+ }
283
+ else if (newValue > maxNum) {
284
+ newValue = maxNum;
285
+ }
286
+ const rounded = this.roundToStep(newValue);
287
+ this.forceValueUpdate(rounded.toString());
288
+ }
270
289
  /** Updates the slider value based on the current input value when enter is pressed */
271
290
  handleInputFieldEnterPress(event) {
272
291
  event.stopPropagation();
@@ -287,7 +306,16 @@ export class TdsSlider {
287
306
  }
288
307
  }
289
308
  calculateInputSizeFromMax() {
290
- return this.max.length;
309
+ const input = this.host.querySelector('tds-text-field input[type="number"]');
310
+ if (input) {
311
+ if (this.readOnly) {
312
+ // explicit size to fit suffix icon
313
+ input.style.width = `${52 + this.max.length * 8}px`;
314
+ }
315
+ else {
316
+ input.setAttribute('size', `${this.max.length}`);
317
+ }
318
+ }
291
319
  }
292
320
  controlsStep(delta, event) {
293
321
  if (this.readOnly || this.disabled) {
@@ -358,6 +386,7 @@ export class TdsSlider {
358
386
  }
359
387
  }
360
388
  componentDidLoad() {
389
+ this.calculateInputSizeFromMax();
361
390
  if (!this.resizeObserverAdded) {
362
391
  this.resizeObserverAdded = true;
363
392
  const resizeObserver = new ResizeObserver(() => {
@@ -401,30 +430,30 @@ export class TdsSlider {
401
430
  }
402
431
  render() {
403
432
  const ariaLabel = this.readOnly ? this.tdsReadOnlyAriaLabel : this.label || this.tdsAriaLabel;
404
- return (h("div", { key: 'b4dd7706df0be052f0028a5f8ba6b6158f403b13', class: {
433
+ return (h("div", { key: '6077f356c7723ce54bdee208039af07154499684', class: {
405
434
  'tds-slider-wrapper': true,
406
435
  'read-only': this.readOnly,
407
- } }, h("input", { key: '672c2aaa6dfee6489cd5e764ef151728c2af10fc', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, step: this.step, value: this.value, disabled: this.disabled }), h("div", { key: '8c7200436a9ef6524a3b2d554a2556bda8cc6afd', class: "sr-only", "aria-live": "assertive", ref: (el) => {
436
+ } }, h("input", { key: '0ee6d0f1c8661bdcae6a3df5eca7b154306338eb', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, step: this.step, value: this.value, disabled: this.disabled }), h("div", { key: 'cfb2700cf9d16c204182a72f9f00ccd03b58ef89', class: "sr-only", "aria-live": "assertive", ref: (el) => {
408
437
  this.ariaLiveElement = el;
409
- } }), h("div", { key: '1ce8e7ddccd19ca15733683768900c8fcde514d3', class: {
438
+ } }), h("div", { key: 'b90c1d06afd96682a108b24506660e7544c4be38', class: {
410
439
  'tds-slider': true,
411
440
  'disabled': this.disabled,
412
441
  'tds-slider-small': this.useSmall,
413
442
  }, ref: (el) => {
414
443
  this.wrapperElement = el;
415
- }, "aria-disabled": this.disabled ? 'true' : 'false' }, h("label", { key: '54616f1cb5e4c13541f6f5fa700ddf4b1c4a9493', id: `${this.sliderId}-label`, class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: 'f6b8283409e9fb74ebf5fe89af5d88c29fde904d', class: "tds-slider__input-values" }, h("div", { key: '30532947c70dc8e0612fea3c01c25a5e86dacfca', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '6c001b8caba4a396bb9f4f4f3ba7b9ee6ca36f84', class: "tds-slider__controls" }, h("div", { key: '7a5804b789f84a4cd749c21d0ecc4b73bf7bae09', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event), role: "button", "aria-label": "Decrease value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: '41db4dc1a8fda4972303fd48400078035648ca5c', name: "minus", size: "16px" })))), h("div", { key: 'f3cb2039ec4245b1d5c58bb819675381c4490197', class: "tds-slider-inner", tabIndex: -1 }, this.tickValues.length > 0 && (h("div", { key: '38bf8ca015894f3a42a0e9e33800cc7f0ff9c8d5', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: '6a5aaa5d652d55f23db24b1b531664d125fc2a23', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '0c99475a8bdb1fdec04358421ec34630111a63b8', class: "tds-slider__track", ref: (el) => {
444
+ }, "aria-disabled": this.disabled ? 'true' : 'false' }, h("label", { key: '3d0bc3f42de59e4397dc8da0edf7ec29802ee8ab', id: `${this.sliderId}-label`, class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: 'c3868e2225cc4dacf60d23e31bdb2b106b85ce22', class: "tds-slider__input-values" }, h("div", { key: 'af100279435087101f37043ea083e5e33d930079', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '83c0078ec0ae39d29582e1ff1f4c3fc5f3a09483', class: "tds-slider__controls" }, h("div", { key: '31947e6cd76c35b8b8e7c0fb92b777e3bf8538b7', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event), role: "button", "aria-label": "Decrease value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: '4c005f8c628236482eecdac51bd43a860f9e38d9', name: "minus", size: "16px" })))), h("div", { key: 'c6f21ded71244d202e255a90039f03872af09d5a', class: "tds-slider-inner", tabIndex: -1 }, this.tickValues.length > 0 && (h("div", { key: 'df1e820e1077ccec24826e38ba1b1fdd8dc0ae90', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'f8cadf57f46068f61d1afc2bbcc30997a750705b', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '389ba385948b6772e803b7b9ec858061451f7534', class: "tds-slider__track", ref: (el) => {
416
445
  this.trackElement = el;
417
446
  }, tabindex: this.disabled ? '-1' : '0', role: "presentation", onFocus: () => {
418
447
  if (this.thumbElement) {
419
448
  this.thumbElement.focus();
420
449
  }
421
- } }, h("div", { key: 'd3ece50db5fbc17e4ebbf4272faa17fcf201dccf', class: "tds-slider__track-fill", ref: (el) => {
450
+ } }, h("div", { key: '5409aec334156fc5c5ac6a2cdbcb38ee50e35259', class: "tds-slider__track-fill", ref: (el) => {
422
451
  this.trackFillElement = el;
423
- } }), h("div", { key: 'c304176e6a240820418d80aa8bfad35fbbdaf0f4', class: "tds-slider__thumb", ref: (el) => {
452
+ } }), h("div", { key: '8e0953ed9771846db11b9f79f6844065494f1b01', class: "tds-slider__thumb", ref: (el) => {
424
453
  this.thumbElement = el;
425
- }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb(), role: "slider", "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": this.value, "aria-valuetext": `${this.value} of ${this.max}`, "aria-labelledby": `${this.sliderId}-label`, "aria-grabbed": this.thumbGrabbed ? 'true' : 'false', "aria-label": ariaLabel, tabindex: this.disabled ? '-1' : '0' }, this.tooltip && (h("div", { key: '7c46c4f8b3cc3bf3aeae7c841a2f38e7b3d1dfbb', class: "tds-slider__value" }, this.value, h("svg", { key: '871a05a8fc1560c8e94071172c57563d63e10f22', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '0c99295a2049b3aac5d0472880e63acc4318fa07', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: 'bf42f5b512d3041a88bd8cc420a5a4aaeb875e49', class: "tds-slider__thumb-inner", ref: (el) => {
454
+ }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb(), role: "slider", "aria-valuemin": this.min, "aria-valuemax": this.max, "aria-valuenow": this.value, "aria-valuetext": `${this.value} of ${this.max}`, "aria-labelledby": `${this.sliderId}-label`, "aria-grabbed": this.thumbGrabbed ? 'true' : 'false', "aria-label": ariaLabel, tabindex: this.disabled ? '-1' : '0' }, this.tooltip && (h("div", { key: 'ed08cca6219adff68babc9c535aff278a1b3325e', class: "tds-slider__value" }, this.value, h("svg", { key: 'dc46d041d7c123400a42ea9c9472cf0a329eb4a1', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '3d46edb2069bd056a2ae09efa4bfa7f6319afe3b', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: '202f2b005a969cd7eb3396c14ef6f72224fcd56a', class: "tds-slider__thumb-inner", ref: (el) => {
426
455
  this.thumbInnerElement = el;
427
- } })))), this.useInput && (h("div", { key: '9a1ed941f13b84e738500921b12aeb21ace2464c', class: "tds-slider__input-values" }, h("div", { key: '2bdf5b0fb2687075b2fc12ce931859d2f26a0685', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '480825ddccd550527ac18f046c6a8ce26baaba87', class: "tds-slider__input-field-wrapper" }, h("input", { key: '94a1446990ea0ae3955e8db9f0119e4a0ec71970', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, "aria-label": this.readOnly ? this.tdsReadOnlyAriaLabel : undefined, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max, step: this.step })))), this.useControls && (h("div", { key: 'b7415e621df023ffe0eca844d9970454d01c72ce', class: "tds-slider__controls" }, h("div", { key: '044a984a7212d56f8c1bcb5709608d90677d7647', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event), role: "button", "aria-label": "Increase value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: '0b6410f7fb4af32681c3f49f29c9696e871bfd5a', name: "plus", size: "16px" })))))));
456
+ } })))), this.useInput && (h("div", { key: 'ca2e84c4bccc24ebbc58a4915f62b5ecb77462c9', class: "tds-slider__input-values" }, h("div", { key: '58fdb8a9a25b9f15314aab8ffaee9424fbb26458', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '4cba8f4c2b8a89922dbaa9eec4c2f9d12f43b62c', class: "tds-slider__input-field-wrapper" }, h("tds-text-field", { key: '65d311769aa5202134676cf9c4652132fbfc364d', noMinWidth: true, size: "sm", type: "number", value: this.value, min: this.min, max: this.max, readOnly: this.readOnly, disabled: this.disabled, onTdsChange: (e) => console.log(e), tdsAriaLabel: this.readOnly ? this.tdsReadOnlyAriaLabel : undefined, onTdsBlur: (event) => this.updateSliderValueFromTextField(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event) })))), this.useControls && (h("div", { key: 'da8881158bee1aec2724a0e71af3faa88bc0eb17', class: "tds-slider__controls" }, h("div", { key: '241b11a3bee6ce8cf3e53ba77a095e2fb0cdb8a6', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event), role: "button", "aria-label": "Increase value", tabindex: this.disabled || this.readOnly ? '-1' : '0' }, h("tds-icon", { key: 'c8e5466b53a1fe6abaaab77741e4adb7ec197341', name: "plus", size: "16px" })))))));
428
457
  }
429
458
  static get is() { return "tds-slider"; }
430
459
  static get originalStyleUrls() {
@@ -62,7 +62,7 @@
62
62
  background-color: var(--tds-navigation-tabs-tab-indicator-background-hover);
63
63
  z-index: 1;
64
64
  }
65
- :host .navigation-tab-item:focus-visible::after {
65
+ :host .navigation-tab-item:hover:focus-within::after {
66
66
  bottom: 3px;
67
67
  }
68
68
  :host .selected ::slotted(*) {
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import generateUniqueId from "../../utils/generateUniqueId";
3
+ import { getAriaInvalid } from "../../utils/getAriaInvalid";
3
4
  export class TdsTextarea {
4
5
  constructor() {
5
6
  this.uuid = generateUniqueId();
@@ -60,7 +61,7 @@ export class TdsTextarea {
60
61
  }
61
62
  render() {
62
63
  var _a;
63
- return (h("div", { key: '873fc5866c777549e56d115e7bce64a62fdd5c0c', class: {
64
+ return (h("div", { key: '68eb00fd2e149732b8d47b72e8b60b2a30dd4d76', class: {
64
65
  'textarea-container': true,
65
66
  'textarea-label-inside': this.labelPosition === 'inside',
66
67
  'textarea-focus': this.focusInput,
@@ -70,7 +71,7 @@ export class TdsTextarea {
70
71
  'textarea-data': this.value !== '',
71
72
  [`textarea-${this.state}`]: this.state === 'error' || this.state === 'success',
72
73
  'no-min-width': this.noMinWidth,
73
- } }, this.labelPosition !== 'no-label' && (h("label", { key: '09f5df4efb39b7e3eb71d8567adc5cffd374ad66', htmlFor: `textarea-element-${this.uuid}`, class: 'textarea-label' }, this.label)), h("div", { key: '57bd6d6e2e7a1919d668625a675e4a20421af965', class: "textarea-wrapper" }, h("textarea", { key: '69955de378170f86c7a942d5f8101aa2ff9440f4', id: `textarea-element-${this.uuid}`, class: 'textarea-input', ref: (inputEl) => {
74
+ } }, this.labelPosition !== 'no-label' && (h("label", { key: '883255abac1da6cec05779b200d5347b6fa740dc', htmlFor: `textarea-element-${this.uuid}`, class: 'textarea-label' }, this.label)), h("div", { key: 'c0eacdcf4b575d14ebd5905785dade6a3f151f0e', class: "textarea-wrapper" }, h("textarea", { key: '940ea2fc206cd567bd2f181e71236cce216ec669', id: `textarea-element-${this.uuid}`, class: 'textarea-input', ref: (inputEl) => {
74
75
  this.textEl = inputEl;
75
76
  }, disabled: this.disabled, readonly: !this.disabled && this.readOnly, placeholder: this.placeholder, value: this.value, name: this.name, autofocus: this.autofocus, maxlength: this.maxLength, cols: this.cols, rows: this.rows, onFocus: (event) => {
76
77
  if (!this.readOnly) {
@@ -80,7 +81,7 @@ export class TdsTextarea {
80
81
  if (!this.readOnly) {
81
82
  this.handleBlur(event);
82
83
  }
83
- }, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), "aria-invalid": this.state === 'error' ? 'true' : 'false', "aria-readonly": this.readOnly ? 'true' : 'false', "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `textarea-helper-element-${this.uuid}` }), h("span", { key: '0fded8e72f3f6d8e6f53cb57df94f480df17ce53', class: "textarea-resizer-icon" }, h("svg", { key: '6b41ae06bbedfa5ba88991bc6856f80ca8a4b6f8', width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'c4f731e7483bade2d0dbd545302afc278039a122', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.8536 0.853553C12.0488 0.658291 12.0488 0.341709 11.8536 0.146447C11.6583 -0.0488155 11.3417 -0.0488155 11.1464 0.146447L0.146447 11.1464C-0.0488155 11.3417 -0.0488155 11.6583 0.146447 11.8536C0.341709 12.0488 0.658291 12.0488 0.853553 11.8536L11.8536 0.853553ZM11.8536 4.64645C12.0488 4.84171 12.0488 5.15829 11.8536 5.35355L5.35355 11.8536C5.15829 12.0488 4.84171 12.0488 4.64645 11.8536C4.45118 11.6583 4.45118 11.3417 4.64645 11.1464L11.1464 4.64645C11.3417 4.45118 11.6583 4.45118 11.8536 4.64645ZM11.8536 8.64645C12.0488 8.84171 12.0488 9.15829 11.8536 9.35355L9.35355 11.8536C9.15829 12.0488 8.84171 12.0488 8.64645 11.8536C8.45118 11.6583 8.45118 11.3417 8.64645 11.1464L11.1464 8.64645C11.3417 8.45118 11.6583 8.45118 11.8536 8.64645Z", fill: "currentColor" }))), !this.disabled && !this.hideReadOnlyIcon && this.readOnly && (h("span", { key: '94bc8eed69418751ad240087201827a0ef0185b4', class: "textarea-icon__readonly" }, h("tds-tooltip", { key: '231983d3994030724a06358f37dd0e53f91d78d4', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: '9e7f16d10939227a5c8c87f00ddd653a58c094ad', id: "readonly-tooltip", name: "edit_inactive", svgTitle: "inactive" })))), h("span", { key: '67222f0c93979caf49881c591cd99eb4c97ebdc1', class: 'textarea-helper', "aria-live": "assertive", id: `textarea-helper-element-${this.uuid}` }, this.state === 'error' && this.helper && !this.readOnly && (h("tds-icon", { key: 'cbde13084b090f7eea4bd80da47373ec941e1981', name: "error", size: "16px" })), this.helper), this.maxLength > 0 && (h("div", { key: '5895277b2e07f4c8f2990f624eb0797dffd0b1f0', class: 'textarea-textcounter' }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { key: '97afedbb5aaf02461a38f39643298b6c2650c52f', class: "textfield-textcounter-divider" }, " / "), " ", this.maxLength))));
84
+ }, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), "aria-invalid": getAriaInvalid(this.host, this.state), "aria-readonly": this.readOnly ? 'true' : 'false', "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `textarea-helper-element-${this.uuid}` }), h("span", { key: 'b821544e95ac75383e05d5fd54b605306f5c6790', class: "textarea-resizer-icon" }, h("svg", { key: '11d6fa83c05cc2511b391bab21d229d057516571', width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '95e8fd6c73070e318d0c5c589fa326ef3480e282', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.8536 0.853553C12.0488 0.658291 12.0488 0.341709 11.8536 0.146447C11.6583 -0.0488155 11.3417 -0.0488155 11.1464 0.146447L0.146447 11.1464C-0.0488155 11.3417 -0.0488155 11.6583 0.146447 11.8536C0.341709 12.0488 0.658291 12.0488 0.853553 11.8536L11.8536 0.853553ZM11.8536 4.64645C12.0488 4.84171 12.0488 5.15829 11.8536 5.35355L5.35355 11.8536C5.15829 12.0488 4.84171 12.0488 4.64645 11.8536C4.45118 11.6583 4.45118 11.3417 4.64645 11.1464L11.1464 4.64645C11.3417 4.45118 11.6583 4.45118 11.8536 4.64645ZM11.8536 8.64645C12.0488 8.84171 12.0488 9.15829 11.8536 9.35355L9.35355 11.8536C9.15829 12.0488 8.84171 12.0488 8.64645 11.8536C8.45118 11.6583 8.45118 11.3417 8.64645 11.1464L11.1464 8.64645C11.3417 8.45118 11.6583 8.45118 11.8536 8.64645Z", fill: "currentColor" }))), !this.disabled && !this.hideReadOnlyIcon && this.readOnly && (h("span", { key: '8628c6ab7310a8dcf7bb2e9f95660a93dc4da3b4', class: "textarea-icon__readonly" }, h("tds-tooltip", { key: '50f5e91b88f8e5e97ec656bed783949464ef8723', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: '3c86f76ddfe425385c9c9b93b0ed3a1e0baf2b20', id: "readonly-tooltip", name: "edit_inactive", svgTitle: "inactive" })))), h("span", { key: '42d22b4fd71e5db663d775e930ae6cc7323a89ec', class: 'textarea-helper', "aria-live": "assertive", id: `textarea-helper-element-${this.uuid}` }, this.state === 'error' && this.helper && !this.readOnly && (h("tds-icon", { key: '088af2b39b4864f48e751d4b44c6d069ebf8ccd6', name: "error", size: "16px" })), this.helper), this.maxLength > 0 && (h("div", { key: 'f425416cfdaed26d6b7b7c619babe478bf63593b', class: 'textarea-textcounter' }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { key: '4d68979b2b8a5601f3b62612f09eb5223cc0490b', class: "textfield-textcounter-divider" }, " / "), " ", this.maxLength))));
84
85
  }
85
86
  static get is() { return "tds-textarea"; }
86
87
  static get encapsulation() { return "scoped"; }
@@ -503,4 +504,5 @@ export class TdsTextarea {
503
504
  }
504
505
  };
505
506
  }
507
+ static get elementRef() { return "host"; }
506
508
  }
@@ -13,25 +13,25 @@
13
13
  border-radius: 4px;
14
14
  }
15
15
  :host .wrapper.information {
16
- border-left: 4px solid var(--tds-toast-icon-color-info);
16
+ border-left: 4px solid var(--tds-toast-color-info);
17
17
  }
18
18
  :host .wrapper.information tds-icon {
19
- color: var(--tds-toast-icon-color-info);
19
+ color: var(--tds-toast-color-info);
20
20
  }
21
21
  :host .wrapper.success {
22
- border-left: 4px solid var(--tds-toast-icon-color-success);
22
+ border-left: 4px solid var(--tds-toast-color-success);
23
23
  }
24
24
  :host .wrapper.success tds-icon {
25
- color: var(--tds-toast-icon-color-success);
25
+ color: var(--tds-toast-color-success);
26
26
  }
27
27
  :host .wrapper.error {
28
- border-left: 4px solid var(--tds-toast-icon-color-error);
28
+ border-left: 4px solid var(--tds-toast-color-error);
29
29
  }
30
30
  :host .wrapper.error tds-icon {
31
- color: var(--tds-toast-icon-color-error);
31
+ color: var(--tds-toast-color-error);
32
32
  }
33
33
  :host .wrapper.warning {
34
- border-left: 4px solid var(--tds-toast-icon-color-warning);
34
+ border-left: 4px solid var(--tds-toast-color-warning);
35
35
  }
36
36
  :host .wrapper.warning tds-icon {
37
37
  color: var(--tds-toast-icon-color-warning);
@@ -12,14 +12,8 @@
12
12
  *
13
13
  */
14
14
  export const getAriaInvalid = (host, state) => {
15
- // Check if aria-invalid is explicitly set on the host element
16
15
  const hostAriaInvalid = host.getAttribute('aria-invalid');
17
16
  if (hostAriaInvalid !== null) {
18
- // Handle boolean values from React (true/false as strings)
19
- if (hostAriaInvalid === 'true' || hostAriaInvalid === 'false') {
20
- return hostAriaInvalid;
21
- }
22
- // Handle other string values (convert to string for consistency)
23
17
  return String(hostAriaInvalid);
24
18
  }
25
19
  // Fallback to state-based aria-invalid
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
3
3
  import { d as defineCustomElement$3 } from './p-9ad61cb5.js';
4
- import { d as defineCustomElement$2 } from './p-6adb1ce3.js';
4
+ import { d as defineCustomElement$2 } from './p-ad6babcd.js';
5
5
  import { d as defineCustomElement$1 } from './p-b390ece5.js';
6
6
 
7
7
  const headerLauncherButtonCss = ":host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}";