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
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
// src/components/slider/types.ts
|
|
2
2
|
import { SLIDER_COLORS, SLIDER_SIZES, SLIDER_EVENTS } from './constants';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Configuration interface for the Slider component
|
|
6
|
-
*/
|
|
7
4
|
export interface SliderConfig {
|
|
8
5
|
/** Minimum value of the slider */
|
|
9
6
|
min?: number;
|
|
@@ -14,7 +11,7 @@ export interface SliderConfig {
|
|
|
14
11
|
/** Current value of the slider */
|
|
15
12
|
value?: number;
|
|
16
13
|
|
|
17
|
-
/** Secondary value for range slider (when using two
|
|
14
|
+
/** Secondary value for range slider (when using two handles) */
|
|
18
15
|
secondValue?: number;
|
|
19
16
|
|
|
20
17
|
/** Step size for discrete slider */
|
|
@@ -41,9 +38,21 @@ export interface SliderConfig {
|
|
|
41
38
|
/** Whether to snap to steps while dragging (discrete slider) */
|
|
42
39
|
snapToSteps?: boolean;
|
|
43
40
|
|
|
44
|
-
/** Whether the slider is a range slider (two
|
|
41
|
+
/** Whether the slider is a range slider (two handles) */
|
|
45
42
|
range?: boolean;
|
|
46
43
|
|
|
44
|
+
/** Label text for the slider */
|
|
45
|
+
label?: string;
|
|
46
|
+
|
|
47
|
+
/** Position of the label (start or end) - defaults to 'start' */
|
|
48
|
+
labelPosition?: 'start' | 'end';
|
|
49
|
+
|
|
50
|
+
/** Icon to display with the slider */
|
|
51
|
+
icon?: string;
|
|
52
|
+
|
|
53
|
+
/** Position of the icon (start or end) */
|
|
54
|
+
iconPosition?: 'start' | 'end';
|
|
55
|
+
|
|
47
56
|
/** Additional CSS classes */
|
|
48
57
|
class?: string;
|
|
49
58
|
|
|
@@ -53,34 +62,28 @@ export interface SliderConfig {
|
|
|
53
62
|
};
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
/**
|
|
57
|
-
* Slider event object
|
|
58
|
-
*/
|
|
59
65
|
export interface SliderEvent {
|
|
60
|
-
/**
|
|
61
|
-
slider:
|
|
66
|
+
/** The slider component that triggered the event */
|
|
67
|
+
slider: any;
|
|
62
68
|
|
|
63
69
|
/** Current slider value */
|
|
64
70
|
value: number;
|
|
65
71
|
|
|
66
|
-
/** Secondary
|
|
67
|
-
secondValue
|
|
72
|
+
/** Secondary value (for range sliders) */
|
|
73
|
+
secondValue: number | null;
|
|
68
74
|
|
|
69
|
-
/** Original event if
|
|
70
|
-
originalEvent
|
|
75
|
+
/** Original DOM event if available */
|
|
76
|
+
originalEvent: Event | null;
|
|
71
77
|
|
|
72
|
-
/**
|
|
78
|
+
/** Function to prevent default behavior */
|
|
73
79
|
preventDefault: () => void;
|
|
74
80
|
|
|
75
|
-
/** Whether default
|
|
81
|
+
/** Whether default behavior was prevented */
|
|
76
82
|
defaultPrevented: boolean;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
/**
|
|
80
|
-
* Slider component interface
|
|
81
|
-
*/
|
|
82
85
|
export interface SliderComponent {
|
|
83
|
-
/**
|
|
86
|
+
/** The root element of the slider */
|
|
84
87
|
element: HTMLElement;
|
|
85
88
|
|
|
86
89
|
/** Sets slider value */
|
|
@@ -95,16 +98,16 @@ export interface SliderComponent {
|
|
|
95
98
|
/** Gets secondary slider value */
|
|
96
99
|
getSecondValue: () => number | null;
|
|
97
100
|
|
|
98
|
-
/** Sets slider minimum */
|
|
101
|
+
/** Sets slider minimum value */
|
|
99
102
|
setMin: (min: number) => SliderComponent;
|
|
100
103
|
|
|
101
|
-
/** Gets slider minimum */
|
|
104
|
+
/** Gets slider minimum value */
|
|
102
105
|
getMin: () => number;
|
|
103
106
|
|
|
104
|
-
/** Sets slider maximum */
|
|
107
|
+
/** Sets slider maximum value */
|
|
105
108
|
setMax: (max: number) => SliderComponent;
|
|
106
109
|
|
|
107
|
-
/** Gets slider maximum */
|
|
110
|
+
/** Gets slider maximum value */
|
|
108
111
|
getMax: () => number;
|
|
109
112
|
|
|
110
113
|
/** Sets slider step size */
|
|
@@ -140,6 +143,18 @@ export interface SliderComponent {
|
|
|
140
143
|
/** Shows or hides current value while dragging */
|
|
141
144
|
showCurrentValue: (show: boolean) => SliderComponent;
|
|
142
145
|
|
|
146
|
+
/** Sets label text */
|
|
147
|
+
setLabel: (text: string) => SliderComponent;
|
|
148
|
+
|
|
149
|
+
/** Gets label text */
|
|
150
|
+
getLabel: () => string;
|
|
151
|
+
|
|
152
|
+
/** Sets icon HTML */
|
|
153
|
+
setIcon: (iconHtml: string) => SliderComponent;
|
|
154
|
+
|
|
155
|
+
/** Gets icon HTML */
|
|
156
|
+
getIcon: () => string;
|
|
157
|
+
|
|
143
158
|
/** Adds event listener */
|
|
144
159
|
on: (event: keyof typeof SLIDER_EVENTS | typeof SLIDER_EVENTS[keyof typeof SLIDER_EVENTS], handler: (event: SliderEvent) => void) => SliderComponent;
|
|
145
160
|
|
|
@@ -5,220 +5,412 @@
|
|
|
5
5
|
@use '../../styles/abstract/mixins' as m;
|
|
6
6
|
@use '../../styles/abstract/theme' as t;
|
|
7
7
|
|
|
8
|
-
$component: '#{base.$prefix}-
|
|
8
|
+
$component: '#{base.$prefix}-tab';
|
|
9
|
+
$container: '#{base.$prefix}-tabs';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
// Tabs Container Styles (1. Container)
|
|
12
|
+
.#{$container} {
|
|
12
13
|
position: relative;
|
|
13
14
|
display: flex;
|
|
14
15
|
flex-direction: column;
|
|
15
16
|
width: 100%;
|
|
17
|
+
background-color: t.color('surface'); // MD3: Surface color
|
|
16
18
|
box-sizing: border-box;
|
|
17
19
|
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
// Basic container sizing
|
|
21
|
+
&--primary {
|
|
22
|
+
min-height: 48px;
|
|
23
|
+
|
|
24
|
+
// Tab container with icons and text needs more space
|
|
25
|
+
&:has(.#{$component}--icon-and-text) {
|
|
26
|
+
min-height: 64px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Primary indicator specific styling
|
|
30
|
+
.#{$container}-indicator {
|
|
31
|
+
height: 4px;
|
|
32
|
+
border-radius: 3px 3px 0 0;
|
|
33
|
+
background-color: t.color('primary');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--secondary {
|
|
38
|
+
min-height: 48px;
|
|
39
|
+
// Tab indicator styling for secondary variant
|
|
40
|
+
.#{$container}-indicator {
|
|
41
|
+
height: 2px;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
background-color: t.color('on-surface');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Scrollable container
|
|
48
|
+
&--scrollable {
|
|
49
|
+
overflow: hidden;
|
|
24
50
|
|
|
25
|
-
|
|
26
|
-
|
|
51
|
+
.#{$container}-scroll {
|
|
52
|
+
display: flex;
|
|
27
53
|
overflow-x: auto;
|
|
28
54
|
scrollbar-width: none; // Firefox
|
|
29
|
-
-ms-overflow-style: none; // IE
|
|
55
|
+
-ms-overflow-style: none; // IE and Edge
|
|
30
56
|
|
|
31
|
-
// Hide scrollbar in WebKit
|
|
32
57
|
&::-webkit-scrollbar {
|
|
33
|
-
display: none;
|
|
58
|
+
display: none; // Chrome, Safari, and Opera
|
|
34
59
|
}
|
|
35
60
|
}
|
|
36
61
|
}
|
|
37
62
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
position:
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
// Container divider (5. Divider)
|
|
64
|
+
&-divider {
|
|
65
|
+
position: absolute;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
height: 1px;
|
|
70
|
+
background-color: t.color('outline-variant'); // MD3: Outline variant color
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Tab indicator styling - base styles
|
|
74
|
+
&-indicator {
|
|
75
|
+
position: absolute;
|
|
76
|
+
bottom: 1px;
|
|
77
|
+
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
78
|
+
width 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
79
|
+
z-index: 1; // Ensure indicator appears above divider
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Individual Tab Styles
|
|
84
|
+
.#{$component} {
|
|
85
|
+
position: relative;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
min-width: 90px;
|
|
90
|
+
max-width: 360px;
|
|
91
|
+
padding: 0 16px;
|
|
92
|
+
border: none;
|
|
93
|
+
border-radius: 5px;
|
|
94
|
+
background-color: transparent;
|
|
95
|
+
color: t.color('on-surface-variant');
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
user-select: none;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
|
|
100
|
+
// Typography for label text (4. Label)
|
|
101
|
+
@include m.typography('label-large');
|
|
102
|
+
|
|
103
|
+
// Transition for state changes
|
|
104
|
+
transition:
|
|
105
|
+
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
106
|
+
color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
107
|
+
|
|
108
|
+
// Container heights based on layout
|
|
109
|
+
&--text-only {
|
|
43
110
|
height: 48px;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&--icon-only {
|
|
114
|
+
height: 48px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--icon-and-text {
|
|
118
|
+
height: 64px;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Focus styles (3/7. Focused state)
|
|
123
|
+
&:focus {
|
|
49
124
|
outline: none;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:focus-visible {
|
|
128
|
+
outline: 2px solid t.color('primary');
|
|
129
|
+
outline-offset: -2px;
|
|
130
|
+
z-index: 1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Disabled state
|
|
134
|
+
&--disabled, &:disabled {
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
opacity: 0.38;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Tab Icon (3. Icon - optional)
|
|
140
|
+
&-icon {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
width: 24px;
|
|
145
|
+
height: 24px;
|
|
53
146
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
147
|
+
svg {
|
|
148
|
+
width: 100%;
|
|
149
|
+
height: 100%;
|
|
150
|
+
fill: currentColor;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Ensure proper vertical spacing for icon and text
|
|
155
|
+
&--icon-and-text {
|
|
156
|
+
.#{$component}-icon {
|
|
157
|
+
margin-bottom: 4px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Tab Text (4. Label)
|
|
162
|
+
&-text {
|
|
163
|
+
@include m.truncate;
|
|
164
|
+
max-width: 100%;
|
|
57
165
|
text-align: center;
|
|
58
|
-
|
|
166
|
+
line-height: 1.2;
|
|
59
167
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
color,
|
|
63
|
-
background-color
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
// Hover state
|
|
67
|
-
&:hover:not(:disabled) {
|
|
68
|
-
@include m.state-layer(t.color('on-surface'), 'hover');
|
|
168
|
+
.#{$component}--icon-only & {
|
|
169
|
+
@include m.visually-hidden;
|
|
69
170
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Badge positioning (2. Badge - optional)
|
|
174
|
+
.#{base.$prefix}-badge-wrapper {
|
|
175
|
+
.#{base.$prefix}-badge {
|
|
176
|
+
// Position for different tab layouts
|
|
177
|
+
&--top-right {
|
|
178
|
+
.#{$component}--icon-only & {
|
|
179
|
+
top: 4px;
|
|
180
|
+
right: 4px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.#{$component}--text-only & {
|
|
184
|
+
top: 8px;
|
|
185
|
+
right: 8px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.#{$component}--icon-and-text & {
|
|
189
|
+
top: 4px;
|
|
190
|
+
right: calc(50% - 20px);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
74
193
|
}
|
|
75
|
-
|
|
76
|
-
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ACTIVE TAB STATES - PRIMARY VARIANT
|
|
197
|
+
.#{$container}--primary & {
|
|
198
|
+
// Active Tab Base State - Apply to primary variant
|
|
77
199
|
&--active {
|
|
78
200
|
color: t.color('primary');
|
|
201
|
+
|
|
202
|
+
.#{$component}-icon {
|
|
203
|
+
color: t.color('primary');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Hover state for active tabs
|
|
207
|
+
&:hover, &.#{$component}--hover {
|
|
208
|
+
background-color: t.alpha('primary', 0.08);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Focused state for active tabs
|
|
212
|
+
&:focus-visible, &.#{$component}--focus {
|
|
213
|
+
background-color: t.alpha('primary', 0.1);
|
|
214
|
+
outline-color: t.color('primary');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Pressed state for active tabs
|
|
218
|
+
&:active, &.#{$component}--pressed {
|
|
219
|
+
background-color: t.alpha('primary', 0.12);
|
|
220
|
+
}
|
|
79
221
|
}
|
|
80
222
|
|
|
81
|
-
//
|
|
82
|
-
&:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
223
|
+
// Inactive Tabs - Primary variant
|
|
224
|
+
&:not(.#{$component}--active):not(.#{$component}--disabled):not(:disabled) {
|
|
225
|
+
color: t.color('on-surface-variant');
|
|
226
|
+
|
|
227
|
+
// Hover state for inactive tabs
|
|
228
|
+
&:hover, &.#{$component}--hover {
|
|
229
|
+
background-color: t.alpha('on-surface-variant', 0.08);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Focused state for inactive tabs
|
|
233
|
+
&:focus-visible, &.#{$component}--focus {
|
|
234
|
+
background-color: t.alpha('on-surface-variant', 0.1);
|
|
235
|
+
outline-color: t.color('on-surface-variant');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Pressed state for inactive tabs
|
|
239
|
+
&:active, &.#{$component}--pressed {
|
|
240
|
+
background-color: t.alpha('on-surface-variant', 0.12);
|
|
241
|
+
}
|
|
93
242
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ACTIVE TAB STATES - SECONDARY VARIANT
|
|
246
|
+
.#{$container}--secondary & {
|
|
247
|
+
// Active Tab - Secondary variant
|
|
248
|
+
&--active {
|
|
249
|
+
color: t.color('on-surface');
|
|
250
|
+
|
|
251
|
+
.#{$component}-icon {
|
|
252
|
+
color: t.color('on-surface');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Hover state for active tabs - secondary
|
|
256
|
+
&:hover, &.#{$component}--hover {
|
|
257
|
+
background-color: t.alpha('on-surface', 0.08);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Focused state for active tabs - secondary
|
|
261
|
+
&:focus-visible, &.#{$component}--focus {
|
|
262
|
+
background-color: t.alpha('on-surface', 0.1);
|
|
263
|
+
outline-color: t.color('on-surface');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Pressed state for active tabs - secondary
|
|
267
|
+
&:active, &.#{$component}--pressed {
|
|
268
|
+
background-color: t.alpha('on-surface', 0.12);
|
|
269
|
+
}
|
|
103
270
|
}
|
|
104
271
|
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
272
|
+
// Inactive Tabs - Secondary variant
|
|
273
|
+
&:not(.#{$component}--active):not(.#{$component}--disabled):not(:disabled) {
|
|
274
|
+
color: t.color('on-surface-variant');
|
|
275
|
+
|
|
276
|
+
// Hover state for inactive tabs - secondary
|
|
277
|
+
&:hover, &.#{$component}--hover {
|
|
278
|
+
background-color: t.alpha('on-surface-variant', 0.08);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Focused state for inactive tabs - secondary
|
|
282
|
+
&:focus-visible, &.#{$component}--focus {
|
|
283
|
+
background-color: t.alpha('on-surface-variant', 0.1);
|
|
284
|
+
outline-color: t.color('on-surface-variant');
|
|
285
|
+
}
|
|
112
286
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
fill: currentColor;
|
|
287
|
+
// Pressed state for inactive tabs - secondary
|
|
288
|
+
&:active, &.#{$component}--pressed {
|
|
289
|
+
background-color: t.alpha('on-surface-variant', 0.12);
|
|
117
290
|
}
|
|
118
291
|
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Ripple effect styling
|
|
295
|
+
.#{$component}-ripple {
|
|
296
|
+
position: absolute;
|
|
297
|
+
top: 0;
|
|
298
|
+
left: 0;
|
|
299
|
+
right: 0;
|
|
300
|
+
bottom: 0;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
border-radius: inherit;
|
|
303
|
+
pointer-events: none;
|
|
119
304
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
305
|
+
.ripple {
|
|
306
|
+
position: absolute;
|
|
307
|
+
border-radius: 50%;
|
|
308
|
+
transform: scale(0);
|
|
309
|
+
pointer-events: none;
|
|
310
|
+
background-color: currentColor;
|
|
311
|
+
opacity: 0.1;
|
|
312
|
+
transform-origin: center;
|
|
123
313
|
}
|
|
124
314
|
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Tab panel styles
|
|
318
|
+
.#{base.$prefix}-tab-panel {
|
|
319
|
+
padding: 16px;
|
|
125
320
|
|
|
126
|
-
|
|
127
|
-
|
|
321
|
+
&[hidden] {
|
|
322
|
+
display: none;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Scroll indicators
|
|
327
|
+
.#{$container} {
|
|
328
|
+
&-scroll-indicator {
|
|
128
329
|
position: absolute;
|
|
330
|
+
top: 0;
|
|
129
331
|
bottom: 0;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
background-color: t.color('primary');
|
|
133
|
-
transform-origin: left center;
|
|
332
|
+
width: 24px;
|
|
333
|
+
pointer-events: none;
|
|
134
334
|
z-index: 1;
|
|
335
|
+
opacity: 0;
|
|
336
|
+
transition: opacity 0.2s ease;
|
|
135
337
|
|
|
136
|
-
|
|
137
|
-
|
|
338
|
+
&.visible {
|
|
339
|
+
opacity: 1;
|
|
138
340
|
}
|
|
139
341
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Variants
|
|
147
|
-
|
|
148
|
-
// Primary variant (default)
|
|
149
|
-
&--primary {
|
|
150
|
-
.#{$component}__tab {
|
|
151
|
-
color: t.color('on-surface-variant');
|
|
152
|
-
|
|
153
|
-
&--active {
|
|
154
|
-
color: t.color('primary');
|
|
155
|
-
}
|
|
342
|
+
&--left {
|
|
343
|
+
left: 0;
|
|
344
|
+
background: linear-gradient(to right, t.color('surface'), transparent);
|
|
156
345
|
}
|
|
157
346
|
|
|
158
|
-
|
|
159
|
-
|
|
347
|
+
&--right {
|
|
348
|
+
right: 0;
|
|
349
|
+
background: linear-gradient(to left, t.color('surface'), transparent);
|
|
160
350
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
351
|
+
|
|
352
|
+
&--shadow {
|
|
353
|
+
&.#{$container}-scroll-indicator--left {
|
|
354
|
+
box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.2);
|
|
355
|
+
background: none;
|
|
356
|
+
}
|
|
167
357
|
|
|
168
|
-
|
|
169
|
-
|
|
358
|
+
&.#{$container}-scroll-indicator--right {
|
|
359
|
+
box-shadow: -2px 0 4px -2px rgba(0, 0, 0, 0.2);
|
|
360
|
+
background: none;
|
|
170
361
|
}
|
|
171
362
|
}
|
|
172
|
-
|
|
173
|
-
.#{$component}__indicator {
|
|
174
|
-
background-color: t.color('secondary');
|
|
175
|
-
}
|
|
176
363
|
}
|
|
177
364
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
365
|
+
&-scroll-button {
|
|
366
|
+
position: absolute;
|
|
367
|
+
top: 50%;
|
|
368
|
+
transform: translateY(-50%);
|
|
369
|
+
width: 40px;
|
|
370
|
+
height: 40px;
|
|
371
|
+
border-radius: 50%;
|
|
372
|
+
background-color: t.color('surface-container-high');
|
|
373
|
+
border: none;
|
|
374
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
|
375
|
+
display: flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
justify-content: center;
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
z-index: 2;
|
|
380
|
+
|
|
381
|
+
&:disabled {
|
|
382
|
+
opacity: 0.38;
|
|
383
|
+
cursor: default;
|
|
384
|
+
}
|
|
183
385
|
|
|
184
|
-
|
|
185
|
-
|
|
386
|
+
svg {
|
|
387
|
+
width: 24px;
|
|
388
|
+
height: 24px;
|
|
389
|
+
fill: t.color('on-surface');
|
|
186
390
|
}
|
|
187
391
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
color: t.color('on-surface');
|
|
191
|
-
|
|
192
|
-
&--active {
|
|
193
|
-
background-color: t.color('surface');
|
|
194
|
-
color: t.color('on-surface');
|
|
195
|
-
@include m.elevation(1);
|
|
196
|
-
}
|
|
392
|
+
&--left {
|
|
393
|
+
left: 4px;
|
|
197
394
|
}
|
|
198
395
|
|
|
199
|
-
|
|
200
|
-
|
|
396
|
+
&--right {
|
|
397
|
+
right: 4px;
|
|
201
398
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
&--neutral {
|
|
206
|
-
.#{$component}__tab {
|
|
207
|
-
color: t.color('on-surface-variant');
|
|
208
|
-
|
|
209
|
-
&--active {
|
|
210
|
-
color: t.color('on-surface');
|
|
211
|
-
}
|
|
399
|
+
|
|
400
|
+
&:focus {
|
|
401
|
+
outline: none;
|
|
212
402
|
}
|
|
213
403
|
|
|
214
|
-
|
|
215
|
-
|
|
404
|
+
&:focus-visible {
|
|
405
|
+
outline: 2px solid t.color('primary');
|
|
216
406
|
}
|
|
217
407
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Responsive styles for small screens
|
|
411
|
+
.#{$container}--responsive-small {
|
|
412
|
+
.#{$component} {
|
|
413
|
+
padding: 0 12px;
|
|
414
|
+
min-width: 72px;
|
|
223
415
|
}
|
|
224
416
|
}
|