mtrl 0.2.4 → 0.2.6
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/package.json +6 -3
- package/src/components/badge/_styles.scss +9 -9
- package/src/components/button/_styles.scss +0 -56
- package/src/components/button/button.ts +0 -2
- package/src/components/button/constants.ts +0 -6
- package/src/components/button/index.ts +2 -2
- package/src/components/button/types.ts +1 -7
- package/src/components/card/_styles.scss +67 -25
- package/src/components/card/api.ts +54 -3
- package/src/components/card/card.ts +33 -2
- package/src/components/card/config.ts +143 -21
- package/src/components/card/constants.ts +20 -19
- package/src/components/card/content.ts +299 -2
- package/src/components/card/features.ts +155 -4
- package/src/components/card/index.ts +31 -9
- package/src/components/card/types.ts +138 -15
- package/src/components/chip/chip.ts +1 -9
- package/src/components/chip/constants.ts +0 -10
- package/src/components/chip/index.ts +1 -1
- package/src/components/chip/types.ts +1 -4
- package/src/components/progress/_styles.scss +0 -65
- package/src/components/progress/config.ts +1 -2
- package/src/components/progress/constants.ts +0 -14
- package/src/components/progress/index.ts +1 -1
- package/src/components/progress/progress.ts +1 -4
- package/src/components/progress/types.ts +1 -4
- package/src/components/radios/_styles.scss +0 -45
- package/src/components/radios/api.ts +85 -60
- package/src/components/radios/config.ts +1 -2
- package/src/components/radios/constants.ts +0 -9
- package/src/components/radios/index.ts +1 -1
- package/src/components/radios/radio.ts +34 -11
- package/src/components/radios/radios.ts +2 -1
- package/src/components/radios/types.ts +1 -7
- package/src/components/slider/_styles.scss +193 -281
- package/src/components/slider/accessibility.md +59 -0
- package/src/components/slider/api.ts +36 -101
- package/src/components/slider/config.ts +29 -78
- package/src/components/slider/constants.ts +12 -8
- package/src/components/slider/features/appearance.ts +1 -47
- package/src/components/slider/features/disabled.ts +41 -16
- package/src/components/slider/features/interactions.ts +166 -26
- package/src/components/slider/features/keyboard.ts +125 -6
- package/src/components/slider/features/structure.ts +182 -195
- package/src/components/slider/features/ui.ts +234 -303
- package/src/components/slider/index.ts +11 -1
- package/src/components/slider/slider.ts +1 -1
- package/src/components/slider/types.ts +10 -25
- package/src/components/tabs/_styles.scss +285 -155
- package/src/components/tabs/api.ts +178 -400
- package/src/components/tabs/config.ts +46 -52
- package/src/components/tabs/constants.ts +85 -8
- package/src/components/tabs/features.ts +401 -0
- package/src/components/tabs/index.ts +60 -3
- package/src/components/tabs/indicator.ts +225 -0
- package/src/components/tabs/responsive.ts +144 -0
- package/src/components/tabs/scroll-indicators.ts +149 -0
- package/src/components/tabs/state.ts +186 -0
- package/src/components/tabs/tab-api.ts +258 -0
- package/src/components/tabs/tab.ts +255 -0
- package/src/components/tabs/tabs.ts +50 -31
- package/src/components/tabs/types.ts +324 -128
- package/src/components/tabs/utils.ts +107 -0
- package/src/components/textfield/_styles.scss +0 -98
- package/src/components/textfield/config.ts +2 -3
- package/src/components/textfield/constants.ts +0 -14
- package/src/components/textfield/index.ts +2 -2
- package/src/components/textfield/textfield.ts +0 -2
- package/src/components/textfield/types.ts +1 -4
- package/src/core/compose/component.ts +1 -1
- package/src/core/compose/features/badge.ts +79 -0
- package/src/core/compose/features/index.ts +3 -1
- package/src/styles/abstract/_theme.scss +106 -2
- package/src/components/card/actions.ts +0 -48
- package/src/components/card/header.ts +0 -88
- package/src/components/card/media.ts +0 -52
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
@use '../../styles/abstract/mixins' as m;
|
|
6
6
|
@use '../../styles/abstract/theme' as t;
|
|
7
7
|
|
|
8
|
+
// $transform: transform 0.2s ease, width 0.2s ease, height 0.2s ease;
|
|
9
|
+
$transform: none;
|
|
10
|
+
|
|
8
11
|
$component: '#{base.$prefix}-slider';
|
|
9
12
|
|
|
10
13
|
.#{$component} {
|
|
@@ -17,6 +20,11 @@ $component: '#{base.$prefix}-slider';
|
|
|
17
20
|
user-select: none;
|
|
18
21
|
touch-action: none;
|
|
19
22
|
|
|
23
|
+
// Container should not have a focus outline
|
|
24
|
+
&:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
&-track {
|
|
21
29
|
position: relative;
|
|
22
30
|
width: 100%;
|
|
@@ -33,8 +41,127 @@ $component: '#{base.$prefix}-slider';
|
|
|
33
41
|
cursor: not-allowed;
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
|
-
|
|
37
|
-
//
|
|
44
|
+
|
|
45
|
+
// Thumb - updated with T-shape and proper focus styles
|
|
46
|
+
&-thumb {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 50%;
|
|
49
|
+
transform: translate(-50%, -50%);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
z-index: 4;
|
|
52
|
+
padding: 4px 0;
|
|
53
|
+
transition: $transform;
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 50px;
|
|
56
|
+
border-radius: 16px;
|
|
57
|
+
background-color: rgba(red, .0);
|
|
58
|
+
|
|
59
|
+
// Focus styles for keyboard navigation
|
|
60
|
+
&:focus {
|
|
61
|
+
outline: 2px solid t.color('outline');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Class added when focused via keyboard
|
|
65
|
+
&--focused {
|
|
66
|
+
// Additional styling when focused
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Create a T-shaped thumb using pseudo-elements
|
|
70
|
+
&::before {
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
content: '';
|
|
73
|
+
position: absolute;
|
|
74
|
+
width: 4px;
|
|
75
|
+
height: 40px;
|
|
76
|
+
background-color: t.color('primary');
|
|
77
|
+
border-radius: 2px;
|
|
78
|
+
left: 50%;
|
|
79
|
+
top: 50%;
|
|
80
|
+
transform: translate(-50%, -50%);
|
|
81
|
+
transition: background-color 0.15s ease, width 0.15s ease;
|
|
82
|
+
|
|
83
|
+
.#{$component}--secondary & {
|
|
84
|
+
background-color: t.color('secondary');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.#{$component}--tertiary & {
|
|
88
|
+
background-color: t.color('tertiary');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.#{$component}--error & {
|
|
92
|
+
background-color: t.color('error');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.#{$component}--disabled & {
|
|
96
|
+
background-color: t.color('on-surface');
|
|
97
|
+
opacity: 0.38;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Enable pointer events on the pseudo-element
|
|
102
|
+
&::before {
|
|
103
|
+
pointer-events: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Make thumb line slimmer during dragging (feedback)
|
|
107
|
+
.#{$component}--dragging & {
|
|
108
|
+
&::before {
|
|
109
|
+
width: 3px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Hover state
|
|
114
|
+
&:hover::before {
|
|
115
|
+
background-color: t.color('primary');
|
|
116
|
+
|
|
117
|
+
.#{$component}--secondary & {
|
|
118
|
+
background-color: t.color('secondary');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$component}--tertiary & {
|
|
122
|
+
background-color: t.color('tertiary');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.#{$component}--error & {
|
|
126
|
+
background-color: t.color('error');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.#{$component}--disabled & {
|
|
130
|
+
background-color: t.color('on-surface');
|
|
131
|
+
opacity: 0.38;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Active state
|
|
136
|
+
&:active::before {
|
|
137
|
+
background-color: t.color('primary');
|
|
138
|
+
width: 3px; // Shrink width when active for visual feedback
|
|
139
|
+
|
|
140
|
+
.#{$component}--secondary & {
|
|
141
|
+
background-color: t.color('secondary');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.#{$component}--tertiary & {
|
|
145
|
+
background-color: t.color('tertiary');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.#{$component}--error & {
|
|
149
|
+
background-color: t.color('error');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Disabled state
|
|
154
|
+
.#{$component}--disabled & {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
|
|
157
|
+
&::before {
|
|
158
|
+
opacity: 0.38;
|
|
159
|
+
background-color: t.color('on-surface');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Start track (for range slider)
|
|
38
165
|
&-start-track {
|
|
39
166
|
position: absolute;
|
|
40
167
|
top: 0;
|
|
@@ -42,8 +169,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
42
169
|
height: 100%;
|
|
43
170
|
background-color: t.color('primary');
|
|
44
171
|
transform-origin: left center;
|
|
45
|
-
|
|
46
|
-
border-radius:
|
|
172
|
+
transition: $transform;
|
|
173
|
+
border-radius: 2px;
|
|
47
174
|
opacity: 0.24;
|
|
48
175
|
z-index: 1;
|
|
49
176
|
|
|
@@ -71,8 +198,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
71
198
|
height: 100%;
|
|
72
199
|
background-color: t.color('primary');
|
|
73
200
|
transform-origin: left center;
|
|
74
|
-
|
|
75
|
-
border-radius:
|
|
201
|
+
transition: $transform;
|
|
202
|
+
border-radius: 2px;
|
|
76
203
|
z-index: 1;
|
|
77
204
|
|
|
78
205
|
.#{$component}--secondary & {
|
|
@@ -88,7 +215,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
88
215
|
}
|
|
89
216
|
}
|
|
90
217
|
|
|
91
|
-
// Remaining track (unfilled part)
|
|
218
|
+
// Remaining track (unfilled part)
|
|
92
219
|
&-remaining-track {
|
|
93
220
|
opacity: .24;
|
|
94
221
|
position: absolute;
|
|
@@ -96,8 +223,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
96
223
|
height: 100%;
|
|
97
224
|
background-color: t.color('primary');
|
|
98
225
|
transform-origin: left center;
|
|
99
|
-
|
|
100
|
-
border-radius:
|
|
226
|
+
transition: $transform;
|
|
227
|
+
border-radius: 2px;
|
|
101
228
|
width: 100%;
|
|
102
229
|
z-index: 0;
|
|
103
230
|
|
|
@@ -118,140 +245,34 @@ $component: '#{base.$prefix}-slider';
|
|
|
118
245
|
}
|
|
119
246
|
}
|
|
120
247
|
|
|
121
|
-
// Dot elements for track ends (
|
|
248
|
+
// Dot elements for track ends (visual anchors for accessibility)
|
|
122
249
|
&-dot {
|
|
123
250
|
pointer-events: none;
|
|
124
251
|
position: absolute;
|
|
125
252
|
width: 4px;
|
|
126
253
|
height: 4px;
|
|
127
254
|
border-radius: 50%;
|
|
128
|
-
background-color: t.color('primary');
|
|
129
255
|
top: 50%;
|
|
130
256
|
transform: translateY(-50%);
|
|
131
257
|
z-index: 1;
|
|
132
258
|
|
|
133
259
|
// Start dot
|
|
134
260
|
&--start {
|
|
135
|
-
left:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// End dot
|
|
139
|
-
&--end {
|
|
140
|
-
right: 4px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Color variants
|
|
144
|
-
.#{$component}--secondary & {
|
|
145
|
-
background-color: t.color('secondary');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.#{$component}--tertiary & {
|
|
149
|
-
background-color: t.color('tertiary');
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.#{$component}--error & {
|
|
153
|
-
background-color: t.color('error');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Disabled state
|
|
157
|
-
.#{$component}--disabled & {
|
|
158
|
-
opacity: 0.38;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Thumb - updated to MD3 style with T-shape
|
|
163
|
-
&-thumb {
|
|
164
|
-
position: absolute;
|
|
165
|
-
top: 50%;
|
|
166
|
-
transform: translate(-50%, -50%);
|
|
167
|
-
cursor: pointer;
|
|
168
|
-
z-index: 2;
|
|
169
|
-
// transition: left 0.1s ease, bottom 0.1s ease;
|
|
170
|
-
width: 16px;
|
|
171
|
-
height: 100%;
|
|
172
|
-
|
|
173
|
-
// Create a T-shaped thumb using pseudo-elements
|
|
174
|
-
&::before {
|
|
175
|
-
pointer-events: none;
|
|
176
|
-
content: '';
|
|
177
|
-
position: absolute;
|
|
178
|
-
width: 4px;
|
|
179
|
-
height: 40px;
|
|
180
|
-
background-color: t.color('primary');
|
|
181
|
-
border-radius: 2px;
|
|
182
|
-
left: 50%;
|
|
183
|
-
top: 50%;
|
|
184
|
-
transform: translate(-50%, -50%);
|
|
185
|
-
transition: background-color 0.15s ease;
|
|
186
|
-
|
|
187
|
-
.#{$component}--secondary & {
|
|
188
|
-
background-color: t.color('secondary');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.#{$component}--tertiary & {
|
|
192
|
-
background-color: t.color('tertiary');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.#{$component}--error & {
|
|
196
|
-
background-color: t.color('error');
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.#{$component}--disabled & {
|
|
200
|
-
background-color: t.color('on-surface');
|
|
201
|
-
opacity: 0.38;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Enable pointer events on the pseudo-elements
|
|
206
|
-
&::before, &::after {
|
|
207
|
-
pointer-events: auto;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Hover state
|
|
211
|
-
&:hover::before, &:hover::after {
|
|
212
|
-
background-color: t.color('primary');
|
|
213
|
-
|
|
214
|
-
.#{$component}--secondary & {
|
|
215
|
-
background-color: t.color('secondary');
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.#{$component}--tertiary & {
|
|
219
|
-
background-color: t.color('tertiary');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.#{$component}--error & {
|
|
223
|
-
background-color: t.color('error');
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.#{$component}--disabled & {
|
|
227
|
-
background-color: t.color('on-surface');
|
|
228
|
-
opacity: 0.38;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Focus state
|
|
233
|
-
&:focus {
|
|
234
|
-
outline: none;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
&:focus::before, &:focus::after {
|
|
238
|
-
background-color: t.color('primary');
|
|
261
|
+
left: 6px;
|
|
262
|
+
background-color: t.color('on-primary');
|
|
239
263
|
|
|
240
264
|
.#{$component}--secondary & {
|
|
241
|
-
background-color: t.color('secondary');
|
|
265
|
+
background-color: t.color('on-secondary');
|
|
242
266
|
}
|
|
243
267
|
|
|
244
268
|
.#{$component}--tertiary & {
|
|
245
|
-
background-color: t.color('tertiary');
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.#{$component}--error & {
|
|
249
|
-
background-color: t.color('error');
|
|
269
|
+
background-color: t.color('on-tertiary');
|
|
250
270
|
}
|
|
251
271
|
}
|
|
252
272
|
|
|
253
|
-
//
|
|
254
|
-
|
|
273
|
+
// End dot
|
|
274
|
+
&--end {
|
|
275
|
+
right: 6px;
|
|
255
276
|
background-color: t.color('primary');
|
|
256
277
|
|
|
257
278
|
.#{$component}--secondary & {
|
|
@@ -261,23 +282,25 @@ $component: '#{base.$prefix}-slider';
|
|
|
261
282
|
.#{$component}--tertiary & {
|
|
262
283
|
background-color: t.color('tertiary');
|
|
263
284
|
}
|
|
264
|
-
|
|
265
|
-
.#{$component}--error & {
|
|
266
|
-
background-color: t.color('error');
|
|
267
|
-
}
|
|
268
285
|
}
|
|
269
286
|
|
|
270
|
-
// Disabled state
|
|
271
287
|
.#{$component}--disabled & {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
&::before, &::after {
|
|
275
|
-
opacity: 0.38;
|
|
276
|
-
background-color: t.color('on-surface');
|
|
277
|
-
}
|
|
288
|
+
opacity: 0.38;
|
|
278
289
|
}
|
|
279
290
|
}
|
|
280
291
|
|
|
292
|
+
|
|
293
|
+
// Container for ticks
|
|
294
|
+
&-ticks-container {
|
|
295
|
+
position: absolute;
|
|
296
|
+
width: 100%;
|
|
297
|
+
height: 100%;
|
|
298
|
+
left: 0;
|
|
299
|
+
top: 0;
|
|
300
|
+
pointer-events: none;
|
|
301
|
+
z-index: 3;
|
|
302
|
+
}
|
|
303
|
+
|
|
281
304
|
// Tick marks
|
|
282
305
|
&-tick {
|
|
283
306
|
position: absolute;
|
|
@@ -288,7 +311,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
288
311
|
top: 50%;
|
|
289
312
|
transform: translate(-50%, -50%);
|
|
290
313
|
pointer-events: none;
|
|
291
|
-
opacity:
|
|
314
|
+
opacity: 1;
|
|
292
315
|
|
|
293
316
|
&:last-child, &:first-child {
|
|
294
317
|
display: none
|
|
@@ -296,35 +319,37 @@ $component: '#{base.$prefix}-slider';
|
|
|
296
319
|
|
|
297
320
|
// Active tick (filled)
|
|
298
321
|
&--active {
|
|
299
|
-
background-color: t.
|
|
322
|
+
background-color: t.color('on-primary');
|
|
300
323
|
|
|
301
324
|
.#{$component}--secondary & {
|
|
302
|
-
background-color: t.
|
|
325
|
+
background-color: t.color('on-secondary');
|
|
303
326
|
}
|
|
304
327
|
|
|
305
328
|
.#{$component}--tertiary & {
|
|
306
|
-
background-color: t.
|
|
329
|
+
background-color: t.color('on-tertiary');
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Inactive tick (unfilled)
|
|
334
|
+
&--inactive {
|
|
335
|
+
background-color: t.color('primary');
|
|
336
|
+
|
|
337
|
+
.#{$component}--secondary & {
|
|
338
|
+
background-color: t.color('secondary');
|
|
307
339
|
}
|
|
308
340
|
|
|
309
|
-
.#{$component}--
|
|
310
|
-
background-color: t.
|
|
341
|
+
.#{$component}--tertiary & {
|
|
342
|
+
background-color: t.color('tertiary');
|
|
311
343
|
}
|
|
312
344
|
}
|
|
345
|
+
|
|
346
|
+
// Hidden tick
|
|
347
|
+
&--hidden {
|
|
348
|
+
opacity: 0
|
|
349
|
+
}
|
|
313
350
|
}
|
|
314
351
|
|
|
315
|
-
//
|
|
316
|
-
&-label {
|
|
317
|
-
position: absolute;
|
|
318
|
-
font-size: 12px;
|
|
319
|
-
color: t.color('on-surface-variant');
|
|
320
|
-
top: 45px;
|
|
321
|
-
transform: translateX(-50%);
|
|
322
|
-
white-space: nowrap;
|
|
323
|
-
pointer-events: none;
|
|
324
|
-
font-weight: 500;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// Range slider styles (for two thumbs)
|
|
352
|
+
// Range slider styles
|
|
328
353
|
&--range {
|
|
329
354
|
.#{$component}-thumb {
|
|
330
355
|
&:nth-of-type(1) {
|
|
@@ -338,24 +363,24 @@ $component: '#{base.$prefix}-slider';
|
|
|
338
363
|
}
|
|
339
364
|
}
|
|
340
365
|
|
|
341
|
-
// Value bubble
|
|
366
|
+
// Value bubble - shows current value during interaction
|
|
342
367
|
&-value {
|
|
343
368
|
position: absolute;
|
|
344
369
|
top: -40px;
|
|
345
370
|
left: 0;
|
|
346
371
|
background-color: t.color('on-surface');
|
|
347
372
|
color: t.color('surface-container-highest');
|
|
348
|
-
padding: 6px
|
|
373
|
+
padding: 6px 12px;
|
|
349
374
|
border-radius: 21px;
|
|
350
|
-
font-size:
|
|
351
|
-
font-weight:
|
|
375
|
+
font-size: 14px;
|
|
376
|
+
font-weight: 600;
|
|
352
377
|
transform: translateX(-50%);
|
|
353
378
|
visibility: hidden;
|
|
354
379
|
opacity: 0;
|
|
355
380
|
transition: opacity 0.2s ease, visibility 0s linear 0.2s;
|
|
356
381
|
pointer-events: none;
|
|
357
382
|
|
|
358
|
-
// Show value when
|
|
383
|
+
// Show value when interacting
|
|
359
384
|
&--visible {
|
|
360
385
|
visibility: visible;
|
|
361
386
|
opacity: 1;
|
|
@@ -363,88 +388,6 @@ $component: '#{base.$prefix}-slider';
|
|
|
363
388
|
}
|
|
364
389
|
}
|
|
365
390
|
|
|
366
|
-
// Vertical orientation
|
|
367
|
-
&--vertical {
|
|
368
|
-
width: 40px;
|
|
369
|
-
height: 200px;
|
|
370
|
-
flex-direction: column;
|
|
371
|
-
|
|
372
|
-
.#{$component}-track {
|
|
373
|
-
width: 16px;
|
|
374
|
-
height: 100%;
|
|
375
|
-
padding: 0;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.#{$component}-active-track {
|
|
379
|
-
width: 100%;
|
|
380
|
-
height: auto;
|
|
381
|
-
transform-origin: bottom center;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.#{$component}-start-track {
|
|
385
|
-
width: 100%;
|
|
386
|
-
height: auto;
|
|
387
|
-
transform-origin: bottom center;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.#{$component}-remaining-track {
|
|
391
|
-
width: 100%;
|
|
392
|
-
bottom: auto;
|
|
393
|
-
top: 0;
|
|
394
|
-
transform-origin: bottom center;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
// Reorient thumb for vertical slider
|
|
398
|
-
.#{$component}-thumb {
|
|
399
|
-
&::before {
|
|
400
|
-
width: 40px;
|
|
401
|
-
height: 4px;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
&::after {
|
|
405
|
-
width: 16px;
|
|
406
|
-
height: 16px;
|
|
407
|
-
top: 50%;
|
|
408
|
-
left: 0;
|
|
409
|
-
transform: translate(0, -50%);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
transform: translate(-50%, 50%);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// Dots for vertical orientation
|
|
416
|
-
.#{$component}-dot {
|
|
417
|
-
left: 50%;
|
|
418
|
-
top: auto;
|
|
419
|
-
transform: translateX(-50%);
|
|
420
|
-
|
|
421
|
-
&--start {
|
|
422
|
-
bottom: 0;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
&--end {
|
|
426
|
-
top: 0;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.#{$component}-tick {
|
|
431
|
-
left: 50%;
|
|
432
|
-
transform: translate(-50%, 50%);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.#{$component}-label {
|
|
436
|
-
top: auto;
|
|
437
|
-
left: 35px;
|
|
438
|
-
transform: translateY(50%);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.#{$component}-value {
|
|
442
|
-
top: auto;
|
|
443
|
-
left: -55px;
|
|
444
|
-
transform: translateY(50%);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
391
|
// Discrete slider with steps
|
|
449
392
|
&--discrete {
|
|
450
393
|
.#{$component}-tick {
|
|
@@ -461,27 +404,6 @@ $component: '#{base.$prefix}-slider';
|
|
|
461
404
|
&::before {
|
|
462
405
|
height: 34px;
|
|
463
406
|
}
|
|
464
|
-
|
|
465
|
-
&::after {
|
|
466
|
-
width: 14px;
|
|
467
|
-
height: 14px;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
&.#{$component}--vertical {
|
|
472
|
-
width: 32px;
|
|
473
|
-
|
|
474
|
-
.#{$component}-thumb {
|
|
475
|
-
&::before {
|
|
476
|
-
width: 34px;
|
|
477
|
-
height: 3px;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
&::after {
|
|
481
|
-
width: 14px;
|
|
482
|
-
height: 14px;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
407
|
}
|
|
486
408
|
}
|
|
487
409
|
|
|
@@ -492,27 +414,17 @@ $component: '#{base.$prefix}-slider';
|
|
|
492
414
|
&::before {
|
|
493
415
|
height: 48px;
|
|
494
416
|
}
|
|
495
|
-
|
|
496
|
-
&::after {
|
|
497
|
-
width: 18px;
|
|
498
|
-
height: 18px;
|
|
499
|
-
}
|
|
500
417
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
&::after {
|
|
512
|
-
width: 18px;
|
|
513
|
-
height: 18px;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// For dragging state - visual feedback
|
|
421
|
+
&--dragging {
|
|
422
|
+
// No transitions during dragging for responsive feel
|
|
423
|
+
.#{$component}-start-track,
|
|
424
|
+
.#{$component}-active-track,
|
|
425
|
+
.#{$component}-remaining-track,
|
|
426
|
+
.#{$component}-thumb {
|
|
427
|
+
transition: none;
|
|
516
428
|
}
|
|
517
429
|
}
|
|
518
430
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Slider Accessibility Enhancements
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Based on the provided accessibility requirements, the slider component has been enhanced to provide better keyboard navigation, visual feedback, and overall accessibility. The changes focus on ensuring that the slider meets Material Design accessibility standards and provides appropriate feedback based on input type.
|
|
6
|
+
|
|
7
|
+
## Key Enhancements
|
|
8
|
+
|
|
9
|
+
### Focus and Keyboard Navigation
|
|
10
|
+
|
|
11
|
+
- **Direct Thumb Focus**: The initial focus now lands directly on the thumb (not the container)
|
|
12
|
+
- **Visual Feedback**: Added a clear outline on focus to provide visual cues for keyboard users
|
|
13
|
+
- **Arrow Key Navigation**:
|
|
14
|
+
- Left/Right arrows change the value by one step
|
|
15
|
+
- Up/Down arrows also change the value (for consistency with other controls)
|
|
16
|
+
- Home/End keys jump to minimum/maximum values
|
|
17
|
+
- Page Up/Down for larger step increments
|
|
18
|
+
- Shift + arrows for faster navigation (10x step size)
|
|
19
|
+
|
|
20
|
+
### Visual Feedback During Interaction
|
|
21
|
+
|
|
22
|
+
- **Thumb Shrinking**: The thumb width shrinks slightly during interaction to provide feedback
|
|
23
|
+
- **Value Display**:
|
|
24
|
+
- Value appears during interaction (touch, drag, mouse click, keyboard navigation)
|
|
25
|
+
- Value remains visible briefly after interaction ends (1.5 seconds)
|
|
26
|
+
- Value position updates to follow the thumb
|
|
27
|
+
|
|
28
|
+
### Visual Anchors for Contrast
|
|
29
|
+
|
|
30
|
+
- **Track End Indicators**: Added dot elements at both ends of the track
|
|
31
|
+
- **Color Contrast**: Ensured sufficient contrast for all elements
|
|
32
|
+
- **Disabled State**: Properly indicated visually and via ARIA attributes
|
|
33
|
+
|
|
34
|
+
## Implementation Details
|
|
35
|
+
|
|
36
|
+
1. **Keyboard Handling**:
|
|
37
|
+
- Enhanced keyboard navigation with proper step calculations
|
|
38
|
+
- Added support for modifier keys (Shift)
|
|
39
|
+
- Set appropriate ARIA attributes for screen readers
|
|
40
|
+
|
|
41
|
+
2. **Interaction Feedback**:
|
|
42
|
+
- Modified CSS to shrink thumb width during active states
|
|
43
|
+
- Enhanced value bubble display timing
|
|
44
|
+
- Improved touch and mouse event handling
|
|
45
|
+
|
|
46
|
+
3. **Focus Management**:
|
|
47
|
+
- Set clear focus styles that work cross-browser
|
|
48
|
+
- Applied focus directly to interactive thumb elements
|
|
49
|
+
- Ensured focus outline is visible against various backgrounds
|
|
50
|
+
|
|
51
|
+
## Keyboard Navigation Map
|
|
52
|
+
|
|
53
|
+
| Keys | Actions |
|
|
54
|
+
|------|---------|
|
|
55
|
+
| Tab | Moves focus to the slider handle |
|
|
56
|
+
| Arrows | Increase and decrease the value by one step |
|
|
57
|
+
| Shift + Arrows | Increase and decrease by 10x step size |
|
|
58
|
+
| Home / End | Set to minimum or maximum value |
|
|
59
|
+
| Page Up / Down | Increase/decrease by larger increments |
|