mtrl 0.2.6 → 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 +117 -109
- 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 -10
- package/src/components/button/api.ts +5 -0
- package/src/components/button/config.ts +5 -0
- package/src/components/button/types.ts +6 -0
- package/src/components/card/card.ts +13 -25
- package/src/components/card/config.ts +67 -22
- package/src/components/card/features.ts +3 -0
- package/src/components/card/types.ts +28 -0
- package/src/components/checkbox/_styles.scss +0 -2
- 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/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 +83 -24
- package/src/components/slider/accessibility.md +5 -5
- package/src/components/slider/api.ts +41 -120
- package/src/components/slider/config.ts +51 -47
- 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 +136 -206
- package/src/components/slider/features/ui.ts +145 -206
- 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 +94 -32
- package/src/components/tabs/features.ts +4 -2
- package/src/components/tabs/indicator.ts +73 -13
- package/src/components/tabs/types.ts +10 -2
- 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/features/icon.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 +9 -1
- 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/navigation/features/items.js +0 -192
- package/src/components/slider/features/appearance.ts +0 -94
- package/src/components/slider/features/disabled.ts +0 -68
- package/src/components/slider/features/events.ts +0 -164
- package/src/components/slider/features/interactions.ts +0 -396
- package/src/components/slider/features/keyboard.ts +0 -233
- package/src/core/collection/adapters/mongodb.js +0 -232
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// src/components/segmented-button/types.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Segmented button selection mode
|
|
5
|
+
* @category Components
|
|
6
|
+
*/
|
|
7
|
+
export enum SelectionMode {
|
|
8
|
+
/** Only one segment can be selected at a time */
|
|
9
|
+
SINGLE = 'single',
|
|
10
|
+
/** Multiple segments can be selected */
|
|
11
|
+
MULTI = 'multi'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for a single segment within a segmented button
|
|
16
|
+
* @category Components
|
|
17
|
+
*/
|
|
18
|
+
export interface SegmentConfig {
|
|
19
|
+
/**
|
|
20
|
+
* Text content for the segment
|
|
21
|
+
* @example 'Day'
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Icon HTML content
|
|
27
|
+
* @example '<svg>...</svg>'
|
|
28
|
+
*/
|
|
29
|
+
icon?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether this segment is initially selected
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
selected?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Value associated with this segment
|
|
39
|
+
*/
|
|
40
|
+
value?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Whether this segment is disabled
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Additional CSS class names for this segment
|
|
50
|
+
*/
|
|
51
|
+
class?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Configuration interface for the Segmented Button component
|
|
56
|
+
* @category Components
|
|
57
|
+
*/
|
|
58
|
+
export interface SegmentedButtonConfig {
|
|
59
|
+
/**
|
|
60
|
+
* Selection mode for the segmented button group
|
|
61
|
+
* @default SelectionMode.SINGLE
|
|
62
|
+
*/
|
|
63
|
+
mode?: SelectionMode;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Array of segment configurations
|
|
67
|
+
*/
|
|
68
|
+
segments?: SegmentConfig[];
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Component prefix for class names
|
|
72
|
+
* @default 'mtrl'
|
|
73
|
+
*/
|
|
74
|
+
prefix?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Component name used in class generation
|
|
78
|
+
*/
|
|
79
|
+
componentName?: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Whether the entire segmented button is initially disabled
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Additional CSS class for the segmented button container
|
|
89
|
+
*/
|
|
90
|
+
class?: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Whether to enable ripple effect
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
ripple?: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Ripple effect configuration
|
|
100
|
+
*/
|
|
101
|
+
rippleConfig?: {
|
|
102
|
+
/** Duration of the ripple animation in milliseconds */
|
|
103
|
+
duration?: number;
|
|
104
|
+
/** Timing function for the ripple animation */
|
|
105
|
+
timing?: string;
|
|
106
|
+
/** Opacity values for ripple start and end [start, end] */
|
|
107
|
+
opacity?: [string, string];
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Interface for a segment within a segmented button
|
|
113
|
+
* @category Components
|
|
114
|
+
*/
|
|
115
|
+
export interface Segment {
|
|
116
|
+
/** The segment's DOM element */
|
|
117
|
+
element: HTMLElement;
|
|
118
|
+
|
|
119
|
+
/** The segment's value */
|
|
120
|
+
value: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Gets whether the segment is selected
|
|
124
|
+
*/
|
|
125
|
+
isSelected: () => boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Sets the segment's selected state
|
|
129
|
+
* @param selected - Whether the segment should be selected
|
|
130
|
+
*/
|
|
131
|
+
setSelected: (selected: boolean) => void;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Gets whether the segment is disabled
|
|
135
|
+
*/
|
|
136
|
+
isDisabled: () => boolean;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Sets the segment's disabled state
|
|
140
|
+
* @param disabled - Whether the segment should be disabled
|
|
141
|
+
*/
|
|
142
|
+
setDisabled: (disabled: boolean) => void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Destroys the segment and cleans up resources
|
|
146
|
+
*/
|
|
147
|
+
destroy: () => void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Segmented Button component interface
|
|
152
|
+
* @category Components
|
|
153
|
+
*/
|
|
154
|
+
export interface SegmentedButtonComponent {
|
|
155
|
+
/** The component's container DOM element */
|
|
156
|
+
element: HTMLElement;
|
|
157
|
+
|
|
158
|
+
/** Array of segment objects */
|
|
159
|
+
segments: Segment[];
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Gets the selected segment(s)
|
|
163
|
+
* @returns An array of selected segments
|
|
164
|
+
*/
|
|
165
|
+
getSelected: () => Segment[];
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Gets the values of selected segment(s)
|
|
169
|
+
* @returns An array of selected segment values
|
|
170
|
+
*/
|
|
171
|
+
getValue: () => string[];
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Selects a segment by its value
|
|
175
|
+
* @param value - The value of the segment to select
|
|
176
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
177
|
+
*/
|
|
178
|
+
select: (value: string) => SegmentedButtonComponent;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Deselects a segment by its value
|
|
182
|
+
* @param value - The value of the segment to deselect
|
|
183
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
184
|
+
*/
|
|
185
|
+
deselect: (value: string) => SegmentedButtonComponent;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Enables the segmented button
|
|
189
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
190
|
+
*/
|
|
191
|
+
enable: () => SegmentedButtonComponent;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Disables the segmented button
|
|
195
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
196
|
+
*/
|
|
197
|
+
disable: () => SegmentedButtonComponent;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Adds an event listener to the segmented button
|
|
201
|
+
* @param event - Event name ('change', etc.)
|
|
202
|
+
* @param handler - Event handler function
|
|
203
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
204
|
+
*/
|
|
205
|
+
on: (event: string, handler: Function) => SegmentedButtonComponent;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Removes an event listener from the segmented button
|
|
209
|
+
* @param event - Event name
|
|
210
|
+
* @param handler - Event handler function
|
|
211
|
+
* @returns The SegmentedButtonComponent for chaining
|
|
212
|
+
*/
|
|
213
|
+
off: (event: string, handler: Function) => SegmentedButtonComponent;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Destroys the component and cleans up resources
|
|
217
|
+
*/
|
|
218
|
+
destroy: () => void;
|
|
219
|
+
}
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
@use '../../styles/abstract/mixins' as m;
|
|
6
6
|
@use '../../styles/abstract/theme' as t;
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
$
|
|
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;
|
|
10
13
|
|
|
11
14
|
$component: '#{base.$prefix}-slider';
|
|
12
15
|
|
|
@@ -14,17 +17,62 @@ $component: '#{base.$prefix}-slider';
|
|
|
14
17
|
// Base styles
|
|
15
18
|
position: relative;
|
|
16
19
|
width: 100%;
|
|
17
|
-
height: 40px;
|
|
18
20
|
display: flex;
|
|
19
|
-
|
|
21
|
+
flex-direction: column;
|
|
20
22
|
user-select: none;
|
|
21
23
|
touch-action: none;
|
|
24
|
+
padding: 8px 0;
|
|
22
25
|
|
|
23
26
|
// Container should not have a focus outline
|
|
24
27
|
&:focus {
|
|
25
28
|
outline: none;
|
|
26
29
|
}
|
|
27
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
|
+
}
|
|
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
|
+
|
|
28
76
|
&-track {
|
|
29
77
|
position: relative;
|
|
30
78
|
width: 100%;
|
|
@@ -42,15 +90,15 @@ $component: '#{base.$prefix}-slider';
|
|
|
42
90
|
}
|
|
43
91
|
}
|
|
44
92
|
|
|
45
|
-
//
|
|
46
|
-
&-
|
|
93
|
+
// Handle - updated with T-shape and proper focus styles
|
|
94
|
+
&-handle {
|
|
47
95
|
position: absolute;
|
|
48
96
|
top: 50%;
|
|
49
97
|
transform: translate(-50%, -50%);
|
|
50
98
|
cursor: pointer;
|
|
51
99
|
z-index: 4;
|
|
52
100
|
padding: 4px 0;
|
|
53
|
-
transition: $
|
|
101
|
+
transition: $handle-transition;
|
|
54
102
|
width: 16px;
|
|
55
103
|
height: 50px;
|
|
56
104
|
border-radius: 16px;
|
|
@@ -66,7 +114,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
66
114
|
// Additional styling when focused
|
|
67
115
|
}
|
|
68
116
|
|
|
69
|
-
// Create a T-shaped
|
|
117
|
+
// Create a T-shaped handle using pseudo-elements
|
|
70
118
|
&::before {
|
|
71
119
|
pointer-events: none;
|
|
72
120
|
content: '';
|
|
@@ -103,7 +151,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
103
151
|
pointer-events: auto;
|
|
104
152
|
}
|
|
105
153
|
|
|
106
|
-
// Make
|
|
154
|
+
// Make handle line slimmer during dragging (feedback)
|
|
107
155
|
.#{$component}--dragging & {
|
|
108
156
|
&::before {
|
|
109
157
|
width: 3px;
|
|
@@ -169,7 +217,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
169
217
|
height: 100%;
|
|
170
218
|
background-color: t.color('primary');
|
|
171
219
|
transform-origin: left center;
|
|
172
|
-
transition: $
|
|
220
|
+
transition: $track-transition;
|
|
173
221
|
border-radius: 2px;
|
|
174
222
|
opacity: 0.24;
|
|
175
223
|
z-index: 1;
|
|
@@ -198,7 +246,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
198
246
|
height: 100%;
|
|
199
247
|
background-color: t.color('primary');
|
|
200
248
|
transform-origin: left center;
|
|
201
|
-
transition: $
|
|
249
|
+
transition: $track-transition;
|
|
202
250
|
border-radius: 2px;
|
|
203
251
|
z-index: 1;
|
|
204
252
|
|
|
@@ -223,9 +271,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
223
271
|
height: 100%;
|
|
224
272
|
background-color: t.color('primary');
|
|
225
273
|
transform-origin: left center;
|
|
226
|
-
transition: $
|
|
274
|
+
transition: $track-transition;
|
|
227
275
|
border-radius: 2px;
|
|
228
|
-
width: 100%;
|
|
229
276
|
z-index: 0;
|
|
230
277
|
|
|
231
278
|
.#{$component}--secondary & {
|
|
@@ -304,14 +351,14 @@ $component: '#{base.$prefix}-slider';
|
|
|
304
351
|
// Tick marks
|
|
305
352
|
&-tick {
|
|
306
353
|
position: absolute;
|
|
307
|
-
width:
|
|
308
|
-
height:
|
|
354
|
+
width: 4px;
|
|
355
|
+
height: 4px;
|
|
309
356
|
background-color: t.color('outline');
|
|
310
357
|
border-radius: 50%;
|
|
311
358
|
top: 50%;
|
|
312
359
|
transform: translate(-50%, -50%);
|
|
313
360
|
pointer-events: none;
|
|
314
|
-
opacity:
|
|
361
|
+
opacity: 0.8;
|
|
315
362
|
|
|
316
363
|
&:last-child, &:first-child {
|
|
317
364
|
display: none
|
|
@@ -333,6 +380,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
333
380
|
// Inactive tick (unfilled)
|
|
334
381
|
&--inactive {
|
|
335
382
|
background-color: t.color('primary');
|
|
383
|
+
opacity: 0.5;
|
|
336
384
|
|
|
337
385
|
.#{$component}--secondary & {
|
|
338
386
|
background-color: t.color('secondary');
|
|
@@ -351,7 +399,7 @@ $component: '#{base.$prefix}-slider';
|
|
|
351
399
|
|
|
352
400
|
// Range slider styles
|
|
353
401
|
&--range {
|
|
354
|
-
.#{$component}-
|
|
402
|
+
.#{$component}-handle {
|
|
355
403
|
&:nth-of-type(1) {
|
|
356
404
|
z-index: 3;
|
|
357
405
|
}
|
|
@@ -377,14 +425,14 @@ $component: '#{base.$prefix}-slider';
|
|
|
377
425
|
transform: translateX(-50%);
|
|
378
426
|
visibility: hidden;
|
|
379
427
|
opacity: 0;
|
|
380
|
-
transition:
|
|
428
|
+
transition: $bubble-transition;
|
|
381
429
|
pointer-events: none;
|
|
382
430
|
|
|
383
431
|
// Show value when interacting
|
|
384
432
|
&--visible {
|
|
385
433
|
visibility: visible;
|
|
386
434
|
opacity: 1;
|
|
387
|
-
transition:
|
|
435
|
+
transition: $bubble-transition-visible;
|
|
388
436
|
}
|
|
389
437
|
}
|
|
390
438
|
|
|
@@ -398,19 +446,29 @@ $component: '#{base.$prefix}-slider';
|
|
|
398
446
|
|
|
399
447
|
// Sizes
|
|
400
448
|
&--small {
|
|
401
|
-
|
|
449
|
+
.#{$component}-container {
|
|
450
|
+
height: 32px;
|
|
451
|
+
}
|
|
402
452
|
|
|
403
|
-
.#{$component}-
|
|
453
|
+
.#{$component}-handle {
|
|
404
454
|
&::before {
|
|
405
455
|
height: 34px;
|
|
406
456
|
}
|
|
407
457
|
}
|
|
408
458
|
}
|
|
409
459
|
|
|
460
|
+
&--medium {
|
|
461
|
+
.#{$component}-container {
|
|
462
|
+
height: 40px;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
410
466
|
&--large {
|
|
411
|
-
|
|
467
|
+
.#{$component}-container {
|
|
468
|
+
height: 48px;
|
|
469
|
+
}
|
|
412
470
|
|
|
413
|
-
.#{$component}-
|
|
471
|
+
.#{$component}-handle {
|
|
414
472
|
&::before {
|
|
415
473
|
height: 48px;
|
|
416
474
|
}
|
|
@@ -423,7 +481,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
423
481
|
.#{$component}-start-track,
|
|
424
482
|
.#{$component}-active-track,
|
|
425
483
|
.#{$component}-remaining-track,
|
|
426
|
-
.#{$component}-
|
|
484
|
+
.#{$component}-handle,
|
|
485
|
+
.#{$component}-value {
|
|
427
486
|
transition: none;
|
|
428
487
|
}
|
|
429
488
|
}
|
|
@@ -8,7 +8,7 @@ Based on the provided accessibility requirements, the slider component has been
|
|
|
8
8
|
|
|
9
9
|
### Focus and Keyboard Navigation
|
|
10
10
|
|
|
11
|
-
- **Direct
|
|
11
|
+
- **Direct Handle Focus**: The initial focus now lands directly on the handle (not the container)
|
|
12
12
|
- **Visual Feedback**: Added a clear outline on focus to provide visual cues for keyboard users
|
|
13
13
|
- **Arrow Key Navigation**:
|
|
14
14
|
- Left/Right arrows change the value by one step
|
|
@@ -19,11 +19,11 @@ Based on the provided accessibility requirements, the slider component has been
|
|
|
19
19
|
|
|
20
20
|
### Visual Feedback During Interaction
|
|
21
21
|
|
|
22
|
-
- **
|
|
22
|
+
- **Handle Shrinking**: The handle width shrinks slightly during interaction to provide feedback
|
|
23
23
|
- **Value Display**:
|
|
24
24
|
- Value appears during interaction (touch, drag, mouse click, keyboard navigation)
|
|
25
25
|
- Value remains visible briefly after interaction ends (1.5 seconds)
|
|
26
|
-
- Value position updates to follow the
|
|
26
|
+
- Value position updates to follow the handle
|
|
27
27
|
|
|
28
28
|
### Visual Anchors for Contrast
|
|
29
29
|
|
|
@@ -39,13 +39,13 @@ Based on the provided accessibility requirements, the slider component has been
|
|
|
39
39
|
- Set appropriate ARIA attributes for screen readers
|
|
40
40
|
|
|
41
41
|
2. **Interaction Feedback**:
|
|
42
|
-
- Modified CSS to shrink
|
|
42
|
+
- Modified CSS to shrink handle width during active states
|
|
43
43
|
- Enhanced value bubble display timing
|
|
44
44
|
- Improved touch and mouse event handling
|
|
45
45
|
|
|
46
46
|
3. **Focus Management**:
|
|
47
47
|
- Set clear focus styles that work cross-browser
|
|
48
|
-
- Applied focus directly to interactive
|
|
48
|
+
- Applied focus directly to interactive handle elements
|
|
49
49
|
- Ensured focus outline is visible against various backgrounds
|
|
50
50
|
|
|
51
51
|
## Keyboard Navigation Map
|