@scania/tegel 1.38.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.
- package/dist/cjs/getAriaInvalid-66a2eade.js +25 -0
- package/dist/cjs/index-ca8040ad.js +6 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/{tds-button.cjs.entry.js → tds-button_2.cjs.entry.js} +25 -0
- package/dist/cjs/tds-card.cjs.entry.js +10 -3
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +55 -22
- package/dist/cjs/tds-link.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +6 -3
- package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +4 -6
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +39 -10
- package/dist/cjs/tds-text-field.cjs.entry.js +6 -5
- package/dist/cjs/tds-textarea.cjs.entry.js +5 -3
- package/dist/cjs/tds-toast.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +8 -4
- package/dist/collection/components/card/card.css +12 -0
- package/dist/collection/components/card/card.js +45 -2
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +13 -3
- package/dist/collection/components/dropdown/dropdown.js +56 -20
- package/dist/collection/components/header/header-item/header-item.css +3 -3
- package/dist/collection/components/link/link.css +13 -15
- package/dist/collection/components/popover-canvas/popover-canvas.css +1 -1
- package/dist/collection/components/popover-canvas/popover-canvas.js +26 -10
- package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +4 -6
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +84 -6
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +82 -6
- package/dist/collection/components/slider/slider.css +24 -28
- package/dist/collection/components/slider/slider.js +38 -9
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.css +1 -1
- package/dist/collection/components/text-field/text-field.js +6 -5
- package/dist/collection/components/textarea/textarea.js +5 -3
- package/dist/collection/components/toast/toast.css +7 -7
- package/dist/collection/utils/getAriaInvalid.js +21 -0
- package/dist/components/{p-63437b77.js → p-072bf53a.js} +1 -1
- package/dist/components/p-3b58a9f3.js +188 -0
- package/dist/components/{p-ea381f94.js → p-92c2da85.js} +1 -1
- package/dist/components/{p-6adb1ce3.js → p-ad6babcd.js} +1 -1
- package/dist/components/p-bbf9492a.js +23 -0
- package/dist/components/{p-d64878cb.js → p-c4318e35.js} +13 -3
- package/dist/{esm/tds-button.entry.js → components/p-c8dc3566.js} +37 -9
- package/dist/components/{p-94bfc9f4.js → p-de36fc8a.js} +44 -20
- package/dist/components/{p-df84759a.js → p-f04f04b5.js} +7 -3
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-button.js +1 -89
- package/dist/components/tds-card.js +27 -6
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +1 -1
- package/dist/components/tds-header-dropdown.js +2 -2
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-item.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +3 -3
- package/dist/components/tds-link.js +1 -1
- package/dist/components/tds-navigation-tab.js +1 -1
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-side-menu-collapse-button.js +5 -7
- package/dist/components/tds-side-menu-dropdown-list-item.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-side-menu-item.js +1 -1
- package/dist/components/tds-slider.js +59 -12
- package/dist/components/tds-table-footer.js +2 -2
- package/dist/components/tds-text-field.js +1 -185
- package/dist/components/tds-textarea.js +5 -3
- package/dist/components/tds-toast.js +1 -1
- package/dist/esm/getAriaInvalid-a9944cb9.js +23 -0
- package/dist/esm/index-51d04e39.js +6 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-button_2.entry.js +87 -0
- package/dist/esm/tds-card.entry.js +10 -3
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +55 -22
- package/dist/esm/tds-link.entry.js +1 -1
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +6 -3
- package/dist/esm/tds-side-menu-collapse-button.entry.js +4 -6
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +39 -10
- package/dist/esm/tds-text-field.entry.js +6 -5
- package/dist/esm/tds-textarea.entry.js +6 -4
- package/dist/esm/tds-toast.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-1859156f.entry.js +1 -0
- package/dist/tegel/p-2c9ea0be.entry.js +1 -0
- package/dist/tegel/p-2f9b15f6.entry.js +1 -0
- package/dist/tegel/p-30901c4d.entry.js +1 -0
- package/dist/tegel/p-336f2de3.entry.js +1 -0
- package/dist/tegel/p-35293420.entry.js +1 -0
- package/dist/tegel/p-4a666337.entry.js +1 -0
- package/dist/tegel/p-628dc7f7.entry.js +1 -0
- package/dist/tegel/p-83e6e31f.entry.js +1 -0
- package/dist/tegel/p-87740f23.entry.js +1 -0
- package/dist/tegel/{p-a74cb560.entry.js → p-af63a774.entry.js} +1 -1
- package/dist/tegel/p-bbf9492a.js +1 -0
- package/dist/tegel/p-c465f9b8.entry.js +1 -0
- package/dist/tegel/p-c4f701f6.entry.js +1 -0
- package/dist/tegel/{p-5734c6ef.entry.js → p-c61ecc8e.entry.js} +1 -1
- package/dist/tegel/{p-db38b4f2.entry.js → p-ecb34850.entry.js} +1 -1
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/card/card.d.ts +10 -0
- package/dist/types/components/dropdown/dropdown.d.ts +4 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +3 -1
- package/dist/types/components/slider/slider.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +1 -0
- package/dist/types/components.d.ts +26 -2
- package/dist/types/utils/getAriaInvalid.d.ts +14 -0
- package/package.json +1 -1
- package/dist/cjs/tds-divider.cjs.entry.js +0 -31
- package/dist/esm/tds-divider.entry.js +0 -27
- package/dist/tegel/p-06d3490c.entry.js +0 -1
- package/dist/tegel/p-25d026a6.entry.js +0 -1
- package/dist/tegel/p-397c8969.entry.js +0 -1
- package/dist/tegel/p-49364819.entry.js +0 -1
- package/dist/tegel/p-4a77edf1.entry.js +0 -1
- package/dist/tegel/p-5c077bb9.entry.js +0 -1
- package/dist/tegel/p-61a1dc59.entry.js +0 -1
- package/dist/tegel/p-a0591e58.entry.js +0 -1
- package/dist/tegel/p-a98767ea.entry.js +0 -1
- package/dist/tegel/p-abad3489.entry.js +0 -1
- package/dist/tegel/p-ae438c2e.entry.js +0 -1
- package/dist/tegel/p-b994e7ac.entry.js +0 -1
- 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
|
|
47
|
-
outline-offset:
|
|
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
|
|
85
|
-
|
|
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
|
-
|
|
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
|
|
97
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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: '
|
|
433
|
+
return (h("div", { key: '6077f356c7723ce54bdee208039af07154499684', class: {
|
|
405
434
|
'tds-slider-wrapper': true,
|
|
406
435
|
'read-only': this.readOnly,
|
|
407
|
-
} }, h("input", { key: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
450
|
+
} }, h("div", { key: '5409aec334156fc5c5ac6a2cdbcb38ee50e35259', class: "tds-slider__track-fill", ref: (el) => {
|
|
422
451
|
this.trackFillElement = el;
|
|
423
|
-
} }), h("div", { key: '
|
|
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: '
|
|
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: '
|
|
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-
|
|
65
|
+
:host .navigation-tab-item:hover:focus-within::after {
|
|
66
66
|
bottom: 3px;
|
|
67
67
|
}
|
|
68
68
|
:host .selected ::slotted(*) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import hasSlot from "../../utils/hasSlot";
|
|
3
3
|
import generateUniqueId from "../../utils/generateUniqueId";
|
|
4
|
+
import { getAriaInvalid } from "../../utils/getAriaInvalid";
|
|
4
5
|
/**
|
|
5
6
|
* @slot prefix - Slot for the prefix in the component.
|
|
6
7
|
* @slot suffix - Slot for the suffix in the component. Suffix is hidden when the input is in readonly state.
|
|
@@ -71,7 +72,7 @@ export class TdsTextField {
|
|
|
71
72
|
var _a;
|
|
72
73
|
const usesPrefixSlot = hasSlot('prefix', this.host);
|
|
73
74
|
const usesSuffixSlot = hasSlot('suffix', this.host);
|
|
74
|
-
return (h("div", { key: '
|
|
75
|
+
return (h("div", { key: '323df30951c2ee070b043228f78c3045b33e2fc9', class: {
|
|
75
76
|
'form-text-field': true,
|
|
76
77
|
'form-text-field-nomin': this.noMinWidth,
|
|
77
78
|
'text-field-focus': this.focusInput && !this.disabled,
|
|
@@ -89,12 +90,12 @@ export class TdsTextField {
|
|
|
89
90
|
'form-text-field-sm': this.size === 'sm',
|
|
90
91
|
'form-text-field-error': this.state === 'error',
|
|
91
92
|
'form-text-field-success': this.state === 'success',
|
|
92
|
-
} }, this.labelPosition === 'outside' && (h("div", { key: '
|
|
93
|
+
} }, this.labelPosition === 'outside' && (h("div", { key: 'fe9768bbf8999dc49f90e096bfd138710a91e7bb', class: "text-field-label-outside" }, h("label", { key: '91d39c768b49e7867a87f7fc78b50ec4034c4560', htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), h("div", { key: 'abb84b67da94a281e986891a00a8bd348ad3b131', onClick: () => this.textInput.focus(), class: "text-field-container" }, usesPrefixSlot && (h("div", { key: '4661114d6fe3e809ee7c0254686c9feb55fce6ad', class: {
|
|
93
94
|
'text-field-slot-wrap-prefix': true,
|
|
94
95
|
'text-field-error': this.state === 'error',
|
|
95
96
|
'text-field-success': this.state === 'success',
|
|
96
97
|
'text-field-default': this.state === 'default',
|
|
97
|
-
} }, h("slot", { key: '
|
|
98
|
+
} }, h("slot", { key: '40aac31a850fb3ad1d703834b578c73a35c9f255', name: "prefix" }))), h("div", { key: '1c85331cb4dd7a03527c3730996f07a5d25293d7', class: "text-field-input-container" }, h("input", { key: '498c3ae25cc2508c28dd2e5f8483c35adb9f8bb9', ref: (inputEl) => {
|
|
98
99
|
this.textInput = inputEl;
|
|
99
100
|
}, class: {
|
|
100
101
|
'text-field-input': true,
|
|
@@ -109,13 +110,13 @@ export class TdsTextField {
|
|
|
109
110
|
if (!this.readOnly) {
|
|
110
111
|
this.handleBlur(event);
|
|
111
112
|
}
|
|
112
|
-
}, "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `text-field-helper-element-${this.uuid}`, "aria-readonly": this.readOnly, id: `text-field-input-element-${this.uuid}` }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { key: '
|
|
113
|
+
}, "aria-invalid": getAriaInvalid(this.host, this.state), "aria-label": this.tdsAriaLabel ? this.tdsAriaLabel : this.label, "aria-describedby": `text-field-helper-element-${this.uuid}`, "aria-readonly": this.readOnly, id: `text-field-input-element-${this.uuid}` }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { key: '41a2f20f416c65fb2d7d9992286f4bc9c9dcc52c', class: "text-field-label-inside", htmlFor: `text-field-input-element-${this.uuid}` }, this.label))), usesSuffixSlot && (h("div", { key: '2b7b63efd24c1398d2d40a3d5a48d3003931cff8', class: {
|
|
113
114
|
'text-field-slot-wrap-suffix': true,
|
|
114
115
|
'text-field-error': this.state === 'error',
|
|
115
116
|
'text-field-success': this.state === 'success',
|
|
116
117
|
'text-field-default': this.state === 'default',
|
|
117
118
|
'tds-u-display-none': this.readOnly,
|
|
118
|
-
} }, h("slot", { key: '
|
|
119
|
+
} }, h("slot", { key: 'b594b47a2ee6bfb393b44c8b704232881e53c119', name: "suffix" }))), this.readOnly && !this.hideReadOnlyIcon && (h("span", { key: '5a9d4e1492b908a397881a42f9c0229d32e2a457', class: "text-field-icon__readonly" }, h("tds-tooltip", { key: '02bb93263fc40d5d6aeb2dda3ad5ac49f2e2ccf6', placement: "top-end", text: "This field is non-editable", selector: "#readonly-tooltip" }), h("tds-icon", { key: 'e926eb2de3946822875badbcc7e325e9981b8271', id: "readonly-tooltip", name: "edit_inactive", size: "20px" })))), h("div", { key: 'ac28d59eb12ef9efe38cd940daf1299b06dd4446', "aria-live": "assertive" }, (this.helper || this.maxLength > 0) && (h("div", { key: 'd1b09c6f543f0e985476b798ee642c6a11cb7485', class: "text-field-helper", id: `text-field-helper-element-${this.uuid}` }, this.state === 'error' && (h("div", { key: '160ca65e021a3f313b828dbcf82b158036d748ad', class: "text-field-helper-error-state" }, !this.readOnly && h("tds-icon", { key: '34bb9eaa6c267d882fc28a9b80fd331523bd981b', name: "error", size: "16px" }), this.helper)), this.state !== 'error' && this.helper, !this.readOnly && this.maxLength > 0 && (h("span", { key: '6b1ad7dbce2e2fe37e116c1d8f0b11f2dfe00260', class: {
|
|
119
120
|
'text-field-textcounter-divider': true,
|
|
120
121
|
'text-field-textcounter-disabled': this.disabled,
|
|
121
122
|
} }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, " / ", this.maxLength)))))));
|
|
@@ -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: '
|
|
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: '
|
|
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
|
|
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-
|
|
16
|
+
border-left: 4px solid var(--tds-toast-color-info);
|
|
17
17
|
}
|
|
18
18
|
:host .wrapper.information tds-icon {
|
|
19
|
-
color: var(--tds-toast-
|
|
19
|
+
color: var(--tds-toast-color-info);
|
|
20
20
|
}
|
|
21
21
|
:host .wrapper.success {
|
|
22
|
-
border-left: 4px solid var(--tds-toast-
|
|
22
|
+
border-left: 4px solid var(--tds-toast-color-success);
|
|
23
23
|
}
|
|
24
24
|
:host .wrapper.success tds-icon {
|
|
25
|
-
color: var(--tds-toast-
|
|
25
|
+
color: var(--tds-toast-color-success);
|
|
26
26
|
}
|
|
27
27
|
:host .wrapper.error {
|
|
28
|
-
border-left: 4px solid var(--tds-toast-
|
|
28
|
+
border-left: 4px solid var(--tds-toast-color-error);
|
|
29
29
|
}
|
|
30
30
|
:host .wrapper.error tds-icon {
|
|
31
|
-
color: var(--tds-toast-
|
|
31
|
+
color: var(--tds-toast-color-error);
|
|
32
32
|
}
|
|
33
33
|
:host .wrapper.warning {
|
|
34
|
-
border-left: 4px solid var(--tds-toast-
|
|
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);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the appropriate aria-invalid value for form components.
|
|
3
|
+
*
|
|
4
|
+
* This utility handles cross-framework compatibility by checking for an explicit
|
|
5
|
+
* aria-invalid attribute on the host element first, then falling back to the
|
|
6
|
+
* component's state. It properly handles both string and boolean values that
|
|
7
|
+
* may be passed from different frameworks (especially React).
|
|
8
|
+
*
|
|
9
|
+
* @param host - The host element to check for aria-invalid attribute
|
|
10
|
+
* @param state - The component's state ('error', 'success', 'default')
|
|
11
|
+
* @returns The aria-invalid value as a string ('true' or 'false')
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export const getAriaInvalid = (host, state) => {
|
|
15
|
+
const hostAriaInvalid = host.getAttribute('aria-invalid');
|
|
16
|
+
if (hostAriaInvalid !== null) {
|
|
17
|
+
return String(hostAriaInvalid);
|
|
18
|
+
}
|
|
19
|
+
// Fallback to state-based aria-invalid
|
|
20
|
+
return state === 'error' ? 'true' : 'false';
|
|
21
|
+
};
|
|
@@ -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-
|
|
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}";
|