mtrl 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/checkbox/api.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts +17 -6
- package/dist/components/chips/api.d.ts +5 -2
- package/dist/components/chips/chip/api.d.ts +1 -1
- package/dist/components/chips/config.d.ts +5 -1
- package/dist/components/chips/types.d.ts +14 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/select/types.d.ts +21 -3
- package/dist/components/switch/types.d.ts +8 -4
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +13 -13
- package/dist/index.js +14 -14
- package/dist/index.js.map +13 -13
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +4 -2
- package/src/styles/abstract/_base.scss +2 -0
- package/src/styles/abstract/_config.scss +28 -0
- package/src/styles/abstract/_functions.scss +124 -0
- package/src/styles/abstract/_mixins.scss +401 -0
- package/src/styles/abstract/_theme.scss +269 -0
- package/src/styles/abstract/_variables.scss +338 -0
- package/src/styles/base/_reset.scss +86 -0
- package/src/styles/base/_typography.scss +155 -0
- package/src/styles/components/_badge.scss +183 -0
- package/src/styles/components/_bottom-app-bar.scss +103 -0
- package/src/styles/components/_button.scss +756 -0
- package/src/styles/components/_card.scss +401 -0
- package/src/styles/components/_carousel.scss +645 -0
- package/src/styles/components/_checkbox.scss +231 -0
- package/src/styles/components/_chips.scss +643 -0
- package/src/styles/components/_datepicker.scss +358 -0
- package/src/styles/components/_dialog.scss +259 -0
- package/src/styles/components/_divider.scss +57 -0
- package/src/styles/components/_extended-fab.scss +309 -0
- package/src/styles/components/_fab.scss +244 -0
- package/src/styles/components/_list.scss +774 -0
- package/src/styles/components/_menu.scss +245 -0
- package/src/styles/components/_navigation-mobile.scss +244 -0
- package/src/styles/components/_navigation-system.scss +151 -0
- package/src/styles/components/_navigation.scss +407 -0
- package/src/styles/components/_progress.scss +101 -0
- package/src/styles/components/_radios.scss +187 -0
- package/src/styles/components/_search.scss +306 -0
- package/src/styles/components/_segmented-button.scss +227 -0
- package/src/styles/components/_select.scss +274 -0
- package/src/styles/components/_sheet.scss +236 -0
- package/src/styles/components/_slider.scss +264 -0
- package/src/styles/components/_snackbar.scss +211 -0
- package/src/styles/components/_switch.scss +305 -0
- package/src/styles/components/_tabs.scss +421 -0
- package/src/styles/components/_textfield.scss +1035 -0
- package/src/styles/components/_timepicker.scss +451 -0
- package/src/styles/components/_tooltip.scss +241 -0
- package/src/styles/components/_top-app-bar.scss +225 -0
- package/src/styles/main.scss +129 -0
- package/src/styles/themes/_autumn.scss +105 -0
- package/src/styles/themes/_base-theme.scss +85 -0
- package/src/styles/themes/_baseline.scss +173 -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 +77 -0
- package/src/styles/themes/_greenbeige.scss +125 -0
- package/src/styles/themes/_index.scss +19 -0
- package/src/styles/themes/_material.scss +125 -0
- package/src/styles/themes/_ocean.scss +77 -0
- package/src/styles/themes/_sageivory.scss +125 -0
- package/src/styles/themes/_spring.scss +77 -0
- package/src/styles/themes/_summer.scss +87 -0
- package/src/styles/themes/_sunset.scss +60 -0
- package/src/styles/themes/_tealcaramel.scss +125 -0
- package/src/styles/themes/_winter.scss +77 -0
- package/src/styles/utilities/_colors.scss +154 -0
- package/src/styles/utilities/_flexbox.scss +194 -0
- package/src/styles/utilities/_layout.scss +665 -0
- package/src/styles/utilities/_ripple.scss +79 -0
- package/src/styles/utilities/_spacing.scss +139 -0
- package/src/styles/utilities/_typography.scss +178 -0
- package/src/styles/utilities/_visibility.scss +142 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// src/components/checkbox/_checkbox.scss
|
|
2
|
+
@use '../../styles/abstract/base' as base;
|
|
3
|
+
@use '../../styles/abstract/variables' as v;
|
|
4
|
+
@use '../../styles/abstract/functions' as f;
|
|
5
|
+
@use '../../styles/abstract/mixins' as m;
|
|
6
|
+
@use '../../styles/abstract/theme' as t;
|
|
7
|
+
|
|
8
|
+
$component: '#{base.$prefix}-checkbox';
|
|
9
|
+
|
|
10
|
+
.#{$component} {
|
|
11
|
+
// Base styles
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
position: relative;
|
|
15
|
+
min-height: 40px;
|
|
16
|
+
padding: 4px 0;
|
|
17
|
+
user-select: none;
|
|
18
|
+
|
|
19
|
+
// Input (visually hidden but accessible)
|
|
20
|
+
&-input {
|
|
21
|
+
position: absolute;
|
|
22
|
+
opacity: 0;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
margin: 0;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
|
|
29
|
+
&:disabled {
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Focus indicator
|
|
34
|
+
&:focus-visible ~ .#{$component}-icon {
|
|
35
|
+
outline: 2px solid t.color('primary');
|
|
36
|
+
outline-offset: 2px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Checkbox visual element
|
|
41
|
+
&-icon {
|
|
42
|
+
position: relative;
|
|
43
|
+
width: 18px;
|
|
44
|
+
height: 18px;
|
|
45
|
+
border-radius: f.get-shape('tiny');
|
|
46
|
+
background-color: t.color('surface-container-highest');
|
|
47
|
+
border: 2px solid t.color('outline');
|
|
48
|
+
@include m.motion-transition(background-color, border-color);
|
|
49
|
+
|
|
50
|
+
// Check mark icon
|
|
51
|
+
svg {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 50%;
|
|
54
|
+
left: 50%;
|
|
55
|
+
width: 18px;
|
|
56
|
+
height: 18px;
|
|
57
|
+
transform: translate(-50%, -50%) scale(0);
|
|
58
|
+
fill: currentColor;
|
|
59
|
+
color: t.color('on-primary');
|
|
60
|
+
transition: transform v.motion('duration-short4') v.motion('easing-emphasized');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Label styling
|
|
65
|
+
&-label {
|
|
66
|
+
@include m.typography('body-large');
|
|
67
|
+
margin-left: 12px;
|
|
68
|
+
color: t.color('on-surface');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Label position variants
|
|
72
|
+
&--label-start {
|
|
73
|
+
.#{$component}-label {
|
|
74
|
+
margin-left: 0;
|
|
75
|
+
margin-right: 12px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--label-end {
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
|
|
82
|
+
.#{$component}-label {
|
|
83
|
+
margin-left: 12px;
|
|
84
|
+
margin-right: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// RTL support
|
|
89
|
+
@include m.rtl {
|
|
90
|
+
&--label-start {
|
|
91
|
+
.#{$component}-label {
|
|
92
|
+
margin-left: 12px;
|
|
93
|
+
margin-right: 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--label-end {
|
|
98
|
+
.#{$component}-label {
|
|
99
|
+
margin-left: 0;
|
|
100
|
+
margin-right: 12px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Checked state
|
|
106
|
+
.#{$component}-input:checked ~ .#{$component}-icon {
|
|
107
|
+
background-color: t.color('primary');
|
|
108
|
+
border-color: t.color('primary');
|
|
109
|
+
|
|
110
|
+
svg {
|
|
111
|
+
transform: translate(-50%, -50%) scale(1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Indeterminate state
|
|
116
|
+
&--indeterminate {
|
|
117
|
+
.#{$component}-icon {
|
|
118
|
+
background-color: t.color('primary');
|
|
119
|
+
border-color: t.color('primary');
|
|
120
|
+
|
|
121
|
+
&::after {
|
|
122
|
+
content: '';
|
|
123
|
+
position: absolute;
|
|
124
|
+
top: 50%;
|
|
125
|
+
left: 50%;
|
|
126
|
+
transform: translate(-50%, -50%);
|
|
127
|
+
width: 10px;
|
|
128
|
+
height: 2px;
|
|
129
|
+
background-color: t.color('on-primary');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
svg {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Disabled state
|
|
139
|
+
&--disabled {
|
|
140
|
+
opacity: 0.38;
|
|
141
|
+
|
|
142
|
+
.#{$component}-input {
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Outlined variant
|
|
148
|
+
&--outlined {
|
|
149
|
+
.#{$component}-icon {
|
|
150
|
+
background-color: transparent;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.#{$component}-input:checked ~ .#{$component}-icon {
|
|
154
|
+
background-color: transparent;
|
|
155
|
+
border-color: t.color('primary');
|
|
156
|
+
|
|
157
|
+
svg {
|
|
158
|
+
color: t.color('primary');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.#{$component}--indeterminate {
|
|
163
|
+
.#{$component}-icon::after {
|
|
164
|
+
background-color: t.color('primary');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// State layer effects
|
|
170
|
+
&:not(&--disabled) {
|
|
171
|
+
// Common state layer structure
|
|
172
|
+
.#{$component}-input:hover ~ .#{$component}-icon::before,
|
|
173
|
+
.#{$component}-input:active ~ .#{$component}-icon::before {
|
|
174
|
+
content: '';
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: -12px;
|
|
177
|
+
left: -12px;
|
|
178
|
+
right: -12px;
|
|
179
|
+
bottom: -12px;
|
|
180
|
+
border-radius: 50%;
|
|
181
|
+
background-color: t.color('on-surface');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Hover state
|
|
185
|
+
.#{$component}-input:hover ~ .#{$component}-icon::before {
|
|
186
|
+
opacity: v.state('hover-state-layer-opacity');
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Hover checked state
|
|
191
|
+
.#{$component}-input:checked:hover ~ .#{$component}-icon::before {
|
|
192
|
+
opacity: v.state('pressed-state-layer-opacity');
|
|
193
|
+
background-color: t.color('primary');
|
|
194
|
+
}
|
|
195
|
+
// Active/pressed state
|
|
196
|
+
.#{$component}-input:active ~ .#{$component}-icon::before {
|
|
197
|
+
opacity: v.state('pressed-state-layer-opacity');
|
|
198
|
+
background-color: t.color('on-surface');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Accessibility
|
|
203
|
+
@include m.reduced-motion {
|
|
204
|
+
.#{$component}-icon,
|
|
205
|
+
.#{$component}-icon svg {
|
|
206
|
+
transition: none;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@include m.high-contrast {
|
|
211
|
+
.#{$component}-icon {
|
|
212
|
+
border-width: 2px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Touch target
|
|
217
|
+
// @include m.touch-target;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Checkbox group layout
|
|
221
|
+
.#{$component}-group {
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: column;
|
|
224
|
+
gap: 8px;
|
|
225
|
+
|
|
226
|
+
&--horizontal {
|
|
227
|
+
flex-direction: row;
|
|
228
|
+
gap: 16px;
|
|
229
|
+
flex-wrap: wrap;
|
|
230
|
+
}
|
|
231
|
+
}
|