mtrl 0.2.5 → 0.2.7
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/index.ts +18 -0
- package/package.json +1 -1
- package/src/components/badge/_styles.scss +123 -115
- package/src/components/badge/api.ts +57 -59
- package/src/components/badge/badge.ts +16 -2
- package/src/components/badge/config.ts +65 -11
- package/src/components/badge/constants.ts +22 -12
- package/src/components/badge/features.ts +44 -40
- package/src/components/badge/types.ts +42 -30
- package/src/components/bottom-app-bar/_styles.scss +103 -0
- package/src/components/bottom-app-bar/bottom-app-bar.ts +196 -0
- package/src/components/bottom-app-bar/config.ts +73 -0
- package/src/components/bottom-app-bar/index.ts +11 -0
- package/src/components/bottom-app-bar/types.ts +108 -0
- package/src/components/button/_styles.scss +0 -66
- package/src/components/button/api.ts +5 -0
- package/src/components/button/button.ts +0 -2
- package/src/components/button/config.ts +5 -0
- package/src/components/button/constants.ts +0 -6
- package/src/components/button/index.ts +2 -2
- package/src/components/button/types.ts +7 -7
- package/src/components/card/_styles.scss +67 -25
- package/src/components/card/api.ts +54 -3
- package/src/components/card/card.ts +25 -6
- package/src/components/card/config.ts +189 -22
- package/src/components/card/constants.ts +20 -19
- package/src/components/card/content.ts +299 -2
- package/src/components/card/features.ts +158 -4
- package/src/components/card/index.ts +31 -9
- package/src/components/card/types.ts +166 -15
- package/src/components/checkbox/_styles.scss +0 -2
- 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/datepicker/_styles.scss +358 -0
- package/src/components/datepicker/api.ts +272 -0
- package/src/components/datepicker/config.ts +144 -0
- package/src/components/datepicker/constants.ts +98 -0
- package/src/components/datepicker/datepicker.ts +346 -0
- package/src/components/datepicker/index.ts +9 -0
- package/src/components/datepicker/render.ts +452 -0
- package/src/components/datepicker/types.ts +268 -0
- package/src/components/datepicker/utils.ts +290 -0
- package/src/components/dialog/_styles.scss +174 -128
- package/src/components/dialog/api.ts +48 -13
- package/src/components/dialog/config.ts +9 -5
- package/src/components/dialog/dialog.ts +6 -3
- package/src/components/dialog/features.ts +290 -130
- package/src/components/dialog/types.ts +7 -4
- package/src/components/divider/_styles.scss +57 -0
- package/src/components/divider/config.ts +81 -0
- package/src/components/divider/divider.ts +37 -0
- package/src/components/divider/features.ts +207 -0
- package/src/components/divider/index.ts +5 -0
- package/src/components/divider/types.ts +55 -0
- package/src/components/extended-fab/_styles.scss +267 -0
- package/src/components/extended-fab/api.ts +141 -0
- package/src/components/extended-fab/config.ts +108 -0
- package/src/components/extended-fab/constants.ts +36 -0
- package/src/components/extended-fab/extended-fab.ts +125 -0
- package/src/components/extended-fab/index.ts +4 -0
- package/src/components/extended-fab/types.ts +287 -0
- package/src/components/fab/_styles.scss +225 -0
- package/src/components/fab/api.ts +97 -0
- package/src/components/fab/config.ts +94 -0
- package/src/components/fab/constants.ts +41 -0
- package/src/components/fab/fab.ts +67 -0
- package/src/components/fab/index.ts +4 -0
- package/src/components/fab/types.ts +234 -0
- package/src/components/navigation/_styles.scss +1 -0
- package/src/components/navigation/api.ts +78 -50
- package/src/components/navigation/features/items.ts +280 -0
- package/src/components/navigation/nav-item.ts +72 -23
- package/src/components/navigation/navigation.ts +54 -2
- package/src/components/navigation/types.ts +210 -188
- 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/search/_styles.scss +306 -0
- package/src/components/search/api.ts +203 -0
- package/src/components/search/config.ts +87 -0
- package/src/components/search/constants.ts +21 -0
- package/src/components/search/features/index.ts +4 -0
- package/src/components/search/features/search.ts +718 -0
- package/src/components/search/features/states.ts +165 -0
- package/src/components/search/features/structure.ts +198 -0
- package/src/components/search/index.ts +10 -0
- package/src/components/search/search.ts +52 -0
- package/src/components/search/types.ts +163 -0
- package/src/components/segmented-button/_styles.scss +117 -0
- package/src/components/segmented-button/config.ts +67 -0
- package/src/components/segmented-button/constants.ts +42 -0
- package/src/components/segmented-button/index.ts +4 -0
- package/src/components/segmented-button/segment.ts +155 -0
- package/src/components/segmented-button/segmented-button.ts +250 -0
- package/src/components/segmented-button/types.ts +219 -0
- package/src/components/slider/_styles.scss +221 -168
- package/src/components/slider/accessibility.md +59 -0
- package/src/components/slider/api.ts +41 -120
- package/src/components/slider/config.ts +51 -49
- package/src/components/slider/features/handlers.ts +495 -0
- package/src/components/slider/features/index.ts +1 -2
- package/src/components/slider/features/slider.ts +66 -84
- package/src/components/slider/features/states.ts +195 -0
- package/src/components/slider/features/structure.ts +141 -184
- package/src/components/slider/features/ui.ts +150 -201
- package/src/components/slider/index.ts +2 -11
- package/src/components/slider/slider.ts +9 -12
- package/src/components/slider/types.ts +39 -24
- package/src/components/switch/_styles.scss +0 -2
- package/src/components/tabs/_styles.scss +346 -154
- 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 +403 -0
- package/src/components/tabs/index.ts +60 -3
- package/src/components/tabs/indicator.ts +285 -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 +332 -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/components/timepicker/README.md +277 -0
- package/src/components/timepicker/_styles.scss +451 -0
- package/src/components/timepicker/api.ts +632 -0
- package/src/components/timepicker/clockdial.ts +482 -0
- package/src/components/timepicker/config.ts +130 -0
- package/src/components/timepicker/constants.ts +138 -0
- package/src/components/timepicker/index.ts +8 -0
- package/src/components/timepicker/render.ts +613 -0
- package/src/components/timepicker/timepicker.ts +117 -0
- package/src/components/timepicker/types.ts +336 -0
- package/src/components/timepicker/utils.ts +241 -0
- package/src/components/top-app-bar/_styles.scss +225 -0
- package/src/components/top-app-bar/config.ts +83 -0
- package/src/components/top-app-bar/index.ts +11 -0
- package/src/components/top-app-bar/top-app-bar.ts +316 -0
- package/src/components/top-app-bar/types.ts +140 -0
- package/src/core/build/_ripple.scss +6 -6
- package/src/core/build/ripple.ts +72 -95
- package/src/core/compose/component.ts +1 -1
- package/src/core/compose/features/badge.ts +79 -0
- package/src/core/compose/features/icon.ts +3 -1
- package/src/core/compose/features/index.ts +3 -1
- package/src/core/compose/features/ripple.ts +4 -1
- package/src/core/compose/features/textlabel.ts +26 -2
- package/src/core/dom/create.ts +5 -0
- package/src/index.ts +9 -0
- package/src/styles/abstract/_theme.scss +115 -3
- package/src/styles/themes/_autumn.scss +21 -0
- package/src/styles/themes/_base-theme.scss +61 -0
- package/src/styles/themes/_baseline.scss +58 -0
- package/src/styles/themes/_bluekhaki.scss +125 -0
- package/src/styles/themes/_brownbeige.scss +125 -0
- package/src/styles/themes/_browngreen.scss +125 -0
- package/src/styles/themes/_forest.scss +6 -0
- package/src/styles/themes/_greenbeige.scss +125 -0
- package/src/styles/themes/_material.scss +125 -0
- package/src/styles/themes/_ocean.scss +6 -0
- package/src/styles/themes/_sageivory.scss +125 -0
- package/src/styles/themes/_spring.scss +6 -0
- package/src/styles/themes/_summer.scss +5 -0
- package/src/styles/themes/_sunset.scss +5 -0
- package/src/styles/themes/_tealcaramel.scss +125 -0
- package/src/styles/themes/_winter.scss +6 -0
- package/src/components/card/actions.ts +0 -48
- package/src/components/card/header.ts +0 -88
- package/src/components/card/media.ts +0 -52
- package/src/components/navigation/features/items.js +0 -192
- package/src/components/slider/features/appearance.ts +0 -94
- package/src/components/slider/features/disabled.ts +0 -43
- package/src/components/slider/features/events.ts +0 -164
- package/src/components/slider/features/interactions.ts +0 -261
- package/src/components/slider/features/keyboard.ts +0 -112
- package/src/core/collection/adapters/mongodb.js +0 -232
|
@@ -5,18 +5,74 @@
|
|
|
5
5
|
@use '../../styles/abstract/mixins' as m;
|
|
6
6
|
@use '../../styles/abstract/theme' as t;
|
|
7
7
|
|
|
8
|
+
// Define the transition properties for smoother animations with absolute positioning
|
|
9
|
+
$track-transition: left 0.2s ease, right 0.2s ease;
|
|
10
|
+
$handle-transition: left 0.2s ease, transform 0.2s ease;
|
|
11
|
+
$bubble-transition: left 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
|
|
12
|
+
$bubble-transition-visible: left 0.2s ease, opacity 0.2s ease, visibility 0s;
|
|
13
|
+
|
|
8
14
|
$component: '#{base.$prefix}-slider';
|
|
9
15
|
|
|
10
16
|
.#{$component} {
|
|
11
17
|
// Base styles
|
|
12
18
|
position: relative;
|
|
13
19
|
width: 100%;
|
|
14
|
-
height: 40px;
|
|
15
20
|
display: flex;
|
|
16
|
-
|
|
21
|
+
flex-direction: column;
|
|
17
22
|
user-select: none;
|
|
18
23
|
touch-action: none;
|
|
24
|
+
padding: 8px 0;
|
|
25
|
+
|
|
26
|
+
// Container should not have a focus outline
|
|
27
|
+
&:focus {
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Label styles
|
|
32
|
+
&-label {
|
|
33
|
+
display: block;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
color: t.color('on-surface');
|
|
37
|
+
margin-bottom: 4px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Icon positioning
|
|
41
|
+
&-icon {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
color: t.color('on-surface-variant');
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 40px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
top: 16px;
|
|
50
|
+
|
|
51
|
+
svg {
|
|
52
|
+
width: 24px;
|
|
53
|
+
height: 24px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
19
56
|
|
|
57
|
+
// When slider has icon at end position
|
|
58
|
+
&--icon {
|
|
59
|
+
.#{$component}-label {
|
|
60
|
+
margin-left: 48px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.#{$component}-container {
|
|
64
|
+
margin-left: 48px;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Slider container - holds all the slider elements
|
|
69
|
+
&-container {
|
|
70
|
+
position: relative;
|
|
71
|
+
height: 40px;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
20
76
|
&-track {
|
|
21
77
|
position: relative;
|
|
22
78
|
width: 100%;
|
|
@@ -33,8 +89,127 @@ $component: '#{base.$prefix}-slider';
|
|
|
33
89
|
cursor: not-allowed;
|
|
34
90
|
}
|
|
35
91
|
}
|
|
36
|
-
|
|
37
|
-
//
|
|
92
|
+
|
|
93
|
+
// Handle - updated with T-shape and proper focus styles
|
|
94
|
+
&-handle {
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: 50%;
|
|
97
|
+
transform: translate(-50%, -50%);
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
z-index: 4;
|
|
100
|
+
padding: 4px 0;
|
|
101
|
+
transition: $handle-transition;
|
|
102
|
+
width: 16px;
|
|
103
|
+
height: 50px;
|
|
104
|
+
border-radius: 16px;
|
|
105
|
+
background-color: rgba(red, .0);
|
|
106
|
+
|
|
107
|
+
// Focus styles for keyboard navigation
|
|
108
|
+
&:focus {
|
|
109
|
+
outline: 2px solid t.color('outline');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Class added when focused via keyboard
|
|
113
|
+
&--focused {
|
|
114
|
+
// Additional styling when focused
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Create a T-shaped handle using pseudo-elements
|
|
118
|
+
&::before {
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
content: '';
|
|
121
|
+
position: absolute;
|
|
122
|
+
width: 4px;
|
|
123
|
+
height: 40px;
|
|
124
|
+
background-color: t.color('primary');
|
|
125
|
+
border-radius: 2px;
|
|
126
|
+
left: 50%;
|
|
127
|
+
top: 50%;
|
|
128
|
+
transform: translate(-50%, -50%);
|
|
129
|
+
transition: background-color 0.15s ease, width 0.15s ease;
|
|
130
|
+
|
|
131
|
+
.#{$component}--secondary & {
|
|
132
|
+
background-color: t.color('secondary');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.#{$component}--tertiary & {
|
|
136
|
+
background-color: t.color('tertiary');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.#{$component}--error & {
|
|
140
|
+
background-color: t.color('error');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.#{$component}--disabled & {
|
|
144
|
+
background-color: t.color('on-surface');
|
|
145
|
+
opacity: 0.38;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Enable pointer events on the pseudo-element
|
|
150
|
+
&::before {
|
|
151
|
+
pointer-events: auto;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Make handle line slimmer during dragging (feedback)
|
|
155
|
+
.#{$component}--dragging & {
|
|
156
|
+
&::before {
|
|
157
|
+
width: 3px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Hover state
|
|
162
|
+
&:hover::before {
|
|
163
|
+
background-color: t.color('primary');
|
|
164
|
+
|
|
165
|
+
.#{$component}--secondary & {
|
|
166
|
+
background-color: t.color('secondary');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.#{$component}--tertiary & {
|
|
170
|
+
background-color: t.color('tertiary');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.#{$component}--error & {
|
|
174
|
+
background-color: t.color('error');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.#{$component}--disabled & {
|
|
178
|
+
background-color: t.color('on-surface');
|
|
179
|
+
opacity: 0.38;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Active state
|
|
184
|
+
&:active::before {
|
|
185
|
+
background-color: t.color('primary');
|
|
186
|
+
width: 3px; // Shrink width when active for visual feedback
|
|
187
|
+
|
|
188
|
+
.#{$component}--secondary & {
|
|
189
|
+
background-color: t.color('secondary');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.#{$component}--tertiary & {
|
|
193
|
+
background-color: t.color('tertiary');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.#{$component}--error & {
|
|
197
|
+
background-color: t.color('error');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Disabled state
|
|
202
|
+
.#{$component}--disabled & {
|
|
203
|
+
cursor: not-allowed;
|
|
204
|
+
|
|
205
|
+
&::before {
|
|
206
|
+
opacity: 0.38;
|
|
207
|
+
background-color: t.color('on-surface');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Start track (for range slider)
|
|
38
213
|
&-start-track {
|
|
39
214
|
position: absolute;
|
|
40
215
|
top: 0;
|
|
@@ -42,7 +217,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
42
217
|
height: 100%;
|
|
43
218
|
background-color: t.color('primary');
|
|
44
219
|
transform-origin: left center;
|
|
45
|
-
|
|
220
|
+
transition: $track-transition;
|
|
46
221
|
border-radius: 2px;
|
|
47
222
|
opacity: 0.24;
|
|
48
223
|
z-index: 1;
|
|
@@ -71,7 +246,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
71
246
|
height: 100%;
|
|
72
247
|
background-color: t.color('primary');
|
|
73
248
|
transform-origin: left center;
|
|
74
|
-
|
|
249
|
+
transition: $track-transition;
|
|
75
250
|
border-radius: 2px;
|
|
76
251
|
z-index: 1;
|
|
77
252
|
|
|
@@ -88,7 +263,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
88
263
|
}
|
|
89
264
|
}
|
|
90
265
|
|
|
91
|
-
// Remaining track (unfilled part)
|
|
266
|
+
// Remaining track (unfilled part)
|
|
92
267
|
&-remaining-track {
|
|
93
268
|
opacity: .24;
|
|
94
269
|
position: absolute;
|
|
@@ -96,9 +271,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
96
271
|
height: 100%;
|
|
97
272
|
background-color: t.color('primary');
|
|
98
273
|
transform-origin: left center;
|
|
99
|
-
|
|
274
|
+
transition: $track-transition;
|
|
100
275
|
border-radius: 2px;
|
|
101
|
-
width: 100%;
|
|
102
276
|
z-index: 0;
|
|
103
277
|
|
|
104
278
|
.#{$component}--secondary & {
|
|
@@ -118,7 +292,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
118
292
|
}
|
|
119
293
|
}
|
|
120
294
|
|
|
121
|
-
// Dot elements for track ends (
|
|
295
|
+
// Dot elements for track ends (visual anchors for accessibility)
|
|
122
296
|
&-dot {
|
|
123
297
|
pointer-events: none;
|
|
124
298
|
position: absolute;
|
|
@@ -132,7 +306,6 @@ $component: '#{base.$prefix}-slider';
|
|
|
132
306
|
// Start dot
|
|
133
307
|
&--start {
|
|
134
308
|
left: 6px;
|
|
135
|
-
// Color variants
|
|
136
309
|
background-color: t.color('on-primary');
|
|
137
310
|
|
|
138
311
|
.#{$component}--secondary & {
|
|
@@ -147,7 +320,6 @@ $component: '#{base.$prefix}-slider';
|
|
|
147
320
|
// End dot
|
|
148
321
|
&--end {
|
|
149
322
|
right: 6px;
|
|
150
|
-
// Color variants
|
|
151
323
|
background-color: t.color('primary');
|
|
152
324
|
|
|
153
325
|
.#{$component}--secondary & {
|
|
@@ -162,136 +334,10 @@ $component: '#{base.$prefix}-slider';
|
|
|
162
334
|
.#{$component}--disabled & {
|
|
163
335
|
opacity: 0.38;
|
|
164
336
|
}
|
|
165
|
-
|
|
166
337
|
}
|
|
167
338
|
|
|
168
|
-
// Thumb - updated to MD3 style with T-shape
|
|
169
|
-
&-thumb {
|
|
170
|
-
position: absolute;
|
|
171
|
-
top: 50%;
|
|
172
|
-
transform: translate(-50%, -50%);
|
|
173
|
-
cursor: pointer;
|
|
174
|
-
z-index: 4;
|
|
175
|
-
// transition: left 0.1s ease, bottom 0.1s ease;
|
|
176
|
-
width: 16px;
|
|
177
|
-
height: 100%;
|
|
178
|
-
|
|
179
|
-
// Create a T-shaped thumb using pseudo-elements
|
|
180
|
-
&::before {
|
|
181
|
-
pointer-events: none;
|
|
182
|
-
content: '';
|
|
183
|
-
position: absolute;
|
|
184
|
-
width: 4px;
|
|
185
|
-
height: 40px;
|
|
186
|
-
background-color: t.color('primary');
|
|
187
|
-
border-radius: 2px;
|
|
188
|
-
left: 50%;
|
|
189
|
-
top: 50%;
|
|
190
|
-
transform: translate(-50%, -50%);
|
|
191
|
-
transition: background-color 0.15s ease, width 0.15s ease;
|
|
192
|
-
|
|
193
|
-
.#{$component}--secondary & {
|
|
194
|
-
background-color: t.color('secondary');
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.#{$component}--tertiary & {
|
|
198
|
-
background-color: t.color('tertiary');
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.#{$component}--error & {
|
|
202
|
-
background-color: t.color('error');
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.#{$component}--disabled & {
|
|
206
|
-
background-color: t.color('on-surface');
|
|
207
|
-
opacity: 0.38;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Enable pointer events on the pseudo-elements
|
|
212
|
-
&::before, &::after {
|
|
213
|
-
pointer-events: auto;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Make thumb line slimmer during dragging
|
|
217
|
-
.#{$component}--dragging & {
|
|
218
|
-
&::before {
|
|
219
|
-
width: 3px;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Hover state
|
|
224
|
-
&:hover::before, &:hover::after {
|
|
225
|
-
background-color: t.color('primary');
|
|
226
|
-
|
|
227
|
-
.#{$component}--secondary & {
|
|
228
|
-
background-color: t.color('secondary');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.#{$component}--tertiary & {
|
|
232
|
-
background-color: t.color('tertiary');
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.#{$component}--error & {
|
|
236
|
-
background-color: t.color('error');
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.#{$component}--disabled & {
|
|
240
|
-
background-color: t.color('on-surface');
|
|
241
|
-
opacity: 0.38;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// Focus state
|
|
246
|
-
&:focus {
|
|
247
|
-
outline: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&:focus::before, &:focus::after {
|
|
251
|
-
background-color: t.color('primary');
|
|
252
|
-
|
|
253
|
-
.#{$component}--secondary & {
|
|
254
|
-
background-color: t.color('secondary');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.#{$component}--tertiary & {
|
|
258
|
-
background-color: t.color('tertiary');
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.#{$component}--error & {
|
|
262
|
-
background-color: t.color('error');
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Active state
|
|
267
|
-
&:active::before, &:active::after {
|
|
268
|
-
background-color: t.color('primary');
|
|
269
|
-
|
|
270
|
-
.#{$component}--secondary & {
|
|
271
|
-
background-color: t.color('secondary');
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.#{$component}--tertiary & {
|
|
275
|
-
background-color: t.color('tertiary');
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.#{$component}--error & {
|
|
279
|
-
background-color: t.color('error');
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// Disabled state
|
|
284
|
-
.#{$component}--disabled & {
|
|
285
|
-
cursor: not-allowed;
|
|
286
|
-
|
|
287
|
-
&::before, &::after {
|
|
288
|
-
opacity: 0.38;
|
|
289
|
-
background-color: t.color('on-surface');
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
339
|
|
|
294
|
-
// Container for ticks
|
|
340
|
+
// Container for ticks
|
|
295
341
|
&-ticks-container {
|
|
296
342
|
position: absolute;
|
|
297
343
|
width: 100%;
|
|
@@ -305,14 +351,14 @@ $component: '#{base.$prefix}-slider';
|
|
|
305
351
|
// Tick marks
|
|
306
352
|
&-tick {
|
|
307
353
|
position: absolute;
|
|
308
|
-
width:
|
|
309
|
-
height:
|
|
354
|
+
width: 4px;
|
|
355
|
+
height: 4px;
|
|
310
356
|
background-color: t.color('outline');
|
|
311
357
|
border-radius: 50%;
|
|
312
358
|
top: 50%;
|
|
313
359
|
transform: translate(-50%, -50%);
|
|
314
360
|
pointer-events: none;
|
|
315
|
-
opacity:
|
|
361
|
+
opacity: 0.8;
|
|
316
362
|
|
|
317
363
|
&:last-child, &:first-child {
|
|
318
364
|
display: none
|
|
@@ -320,7 +366,6 @@ $component: '#{base.$prefix}-slider';
|
|
|
320
366
|
|
|
321
367
|
// Active tick (filled)
|
|
322
368
|
&--active {
|
|
323
|
-
// background-color: white;
|
|
324
369
|
background-color: t.color('on-primary');
|
|
325
370
|
|
|
326
371
|
.#{$component}--secondary & {
|
|
@@ -335,6 +380,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
335
380
|
// Inactive tick (unfilled)
|
|
336
381
|
&--inactive {
|
|
337
382
|
background-color: t.color('primary');
|
|
383
|
+
opacity: 0.5;
|
|
338
384
|
|
|
339
385
|
.#{$component}--secondary & {
|
|
340
386
|
background-color: t.color('secondary');
|
|
@@ -351,9 +397,9 @@ $component: '#{base.$prefix}-slider';
|
|
|
351
397
|
}
|
|
352
398
|
}
|
|
353
399
|
|
|
354
|
-
// Range slider styles
|
|
400
|
+
// Range slider styles
|
|
355
401
|
&--range {
|
|
356
|
-
.#{$component}-
|
|
402
|
+
.#{$component}-handle {
|
|
357
403
|
&:nth-of-type(1) {
|
|
358
404
|
z-index: 3;
|
|
359
405
|
}
|
|
@@ -365,28 +411,28 @@ $component: '#{base.$prefix}-slider';
|
|
|
365
411
|
}
|
|
366
412
|
}
|
|
367
413
|
|
|
368
|
-
// Value bubble
|
|
414
|
+
// Value bubble - shows current value during interaction
|
|
369
415
|
&-value {
|
|
370
416
|
position: absolute;
|
|
371
417
|
top: -40px;
|
|
372
418
|
left: 0;
|
|
373
419
|
background-color: t.color('on-surface');
|
|
374
420
|
color: t.color('surface-container-highest');
|
|
375
|
-
padding: 6px
|
|
421
|
+
padding: 6px 12px;
|
|
376
422
|
border-radius: 21px;
|
|
377
|
-
font-size:
|
|
378
|
-
font-weight:
|
|
423
|
+
font-size: 14px;
|
|
424
|
+
font-weight: 600;
|
|
379
425
|
transform: translateX(-50%);
|
|
380
426
|
visibility: hidden;
|
|
381
427
|
opacity: 0;
|
|
382
|
-
transition:
|
|
428
|
+
transition: $bubble-transition;
|
|
383
429
|
pointer-events: none;
|
|
384
430
|
|
|
385
|
-
// Show value when
|
|
431
|
+
// Show value when interacting
|
|
386
432
|
&--visible {
|
|
387
433
|
visibility: visible;
|
|
388
434
|
opacity: 1;
|
|
389
|
-
transition:
|
|
435
|
+
transition: $bubble-transition-visible;
|
|
390
436
|
}
|
|
391
437
|
}
|
|
392
438
|
|
|
@@ -400,37 +446,44 @@ $component: '#{base.$prefix}-slider';
|
|
|
400
446
|
|
|
401
447
|
// Sizes
|
|
402
448
|
&--small {
|
|
403
|
-
|
|
449
|
+
.#{$component}-container {
|
|
450
|
+
height: 32px;
|
|
451
|
+
}
|
|
404
452
|
|
|
405
|
-
.#{$component}-
|
|
453
|
+
.#{$component}-handle {
|
|
406
454
|
&::before {
|
|
407
455
|
height: 34px;
|
|
408
456
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&--medium {
|
|
461
|
+
.#{$component}-container {
|
|
462
|
+
height: 40px;
|
|
414
463
|
}
|
|
415
464
|
}
|
|
416
465
|
|
|
417
466
|
&--large {
|
|
418
|
-
|
|
467
|
+
.#{$component}-container {
|
|
468
|
+
height: 48px;
|
|
469
|
+
}
|
|
419
470
|
|
|
420
|
-
.#{$component}-
|
|
471
|
+
.#{$component}-handle {
|
|
421
472
|
&::before {
|
|
422
473
|
height: 48px;
|
|
423
474
|
}
|
|
424
|
-
|
|
425
|
-
&::after {
|
|
426
|
-
width: 18px;
|
|
427
|
-
height: 18px;
|
|
428
|
-
}
|
|
429
475
|
}
|
|
430
476
|
}
|
|
431
477
|
|
|
432
|
-
// For dragging state
|
|
478
|
+
// For dragging state - visual feedback
|
|
433
479
|
&--dragging {
|
|
434
|
-
//
|
|
480
|
+
// No transitions during dragging for responsive feel
|
|
481
|
+
.#{$component}-start-track,
|
|
482
|
+
.#{$component}-active-track,
|
|
483
|
+
.#{$component}-remaining-track,
|
|
484
|
+
.#{$component}-handle,
|
|
485
|
+
.#{$component}-value {
|
|
486
|
+
transition: none;
|
|
487
|
+
}
|
|
435
488
|
}
|
|
436
489
|
}
|
|
@@ -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 Handle Focus**: The initial focus now lands directly on the handle (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
|
+
- **Handle Shrinking**: The handle 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 handle
|
|
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 handle 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 handle 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 |
|