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.
Files changed (80) hide show
  1. package/dist/components/checkbox/api.d.ts +1 -1
  2. package/dist/components/checkbox/types.d.ts +17 -6
  3. package/dist/components/chips/api.d.ts +5 -2
  4. package/dist/components/chips/chip/api.d.ts +1 -1
  5. package/dist/components/chips/config.d.ts +5 -1
  6. package/dist/components/chips/types.d.ts +14 -3
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/select/types.d.ts +21 -3
  9. package/dist/components/switch/types.d.ts +8 -4
  10. package/dist/index.cjs +14 -14
  11. package/dist/index.cjs.map +13 -13
  12. package/dist/index.js +14 -14
  13. package/dist/index.js.map +13 -13
  14. package/dist/package.json +1 -1
  15. package/dist/styles.css +2 -2
  16. package/package.json +4 -2
  17. package/src/styles/abstract/_base.scss +2 -0
  18. package/src/styles/abstract/_config.scss +28 -0
  19. package/src/styles/abstract/_functions.scss +124 -0
  20. package/src/styles/abstract/_mixins.scss +401 -0
  21. package/src/styles/abstract/_theme.scss +269 -0
  22. package/src/styles/abstract/_variables.scss +338 -0
  23. package/src/styles/base/_reset.scss +86 -0
  24. package/src/styles/base/_typography.scss +155 -0
  25. package/src/styles/components/_badge.scss +183 -0
  26. package/src/styles/components/_bottom-app-bar.scss +103 -0
  27. package/src/styles/components/_button.scss +756 -0
  28. package/src/styles/components/_card.scss +401 -0
  29. package/src/styles/components/_carousel.scss +645 -0
  30. package/src/styles/components/_checkbox.scss +231 -0
  31. package/src/styles/components/_chips.scss +643 -0
  32. package/src/styles/components/_datepicker.scss +358 -0
  33. package/src/styles/components/_dialog.scss +259 -0
  34. package/src/styles/components/_divider.scss +57 -0
  35. package/src/styles/components/_extended-fab.scss +309 -0
  36. package/src/styles/components/_fab.scss +244 -0
  37. package/src/styles/components/_list.scss +774 -0
  38. package/src/styles/components/_menu.scss +245 -0
  39. package/src/styles/components/_navigation-mobile.scss +244 -0
  40. package/src/styles/components/_navigation-system.scss +151 -0
  41. package/src/styles/components/_navigation.scss +407 -0
  42. package/src/styles/components/_progress.scss +101 -0
  43. package/src/styles/components/_radios.scss +187 -0
  44. package/src/styles/components/_search.scss +306 -0
  45. package/src/styles/components/_segmented-button.scss +227 -0
  46. package/src/styles/components/_select.scss +274 -0
  47. package/src/styles/components/_sheet.scss +236 -0
  48. package/src/styles/components/_slider.scss +264 -0
  49. package/src/styles/components/_snackbar.scss +211 -0
  50. package/src/styles/components/_switch.scss +305 -0
  51. package/src/styles/components/_tabs.scss +421 -0
  52. package/src/styles/components/_textfield.scss +1035 -0
  53. package/src/styles/components/_timepicker.scss +451 -0
  54. package/src/styles/components/_tooltip.scss +241 -0
  55. package/src/styles/components/_top-app-bar.scss +225 -0
  56. package/src/styles/main.scss +129 -0
  57. package/src/styles/themes/_autumn.scss +105 -0
  58. package/src/styles/themes/_base-theme.scss +85 -0
  59. package/src/styles/themes/_baseline.scss +173 -0
  60. package/src/styles/themes/_bluekhaki.scss +125 -0
  61. package/src/styles/themes/_brownbeige.scss +125 -0
  62. package/src/styles/themes/_browngreen.scss +125 -0
  63. package/src/styles/themes/_forest.scss +77 -0
  64. package/src/styles/themes/_greenbeige.scss +125 -0
  65. package/src/styles/themes/_index.scss +19 -0
  66. package/src/styles/themes/_material.scss +125 -0
  67. package/src/styles/themes/_ocean.scss +77 -0
  68. package/src/styles/themes/_sageivory.scss +125 -0
  69. package/src/styles/themes/_spring.scss +77 -0
  70. package/src/styles/themes/_summer.scss +87 -0
  71. package/src/styles/themes/_sunset.scss +60 -0
  72. package/src/styles/themes/_tealcaramel.scss +125 -0
  73. package/src/styles/themes/_winter.scss +77 -0
  74. package/src/styles/utilities/_colors.scss +154 -0
  75. package/src/styles/utilities/_flexbox.scss +194 -0
  76. package/src/styles/utilities/_layout.scss +665 -0
  77. package/src/styles/utilities/_ripple.scss +79 -0
  78. package/src/styles/utilities/_spacing.scss +139 -0
  79. package/src/styles/utilities/_typography.scss +178 -0
  80. package/src/styles/utilities/_visibility.scss +142 -0
@@ -0,0 +1,407 @@
1
+ // src/components/navigation/_navigation.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}-nav';
9
+
10
+ // BASE STYLES
11
+ .#{$component} {
12
+ display: flex;
13
+ position: relative;
14
+ background-color: t.color('surface-container');
15
+
16
+ // Base nav item styles
17
+ &-item {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ position: relative;
22
+ border: none;
23
+ background: none;
24
+ cursor: pointer;
25
+ padding: 12px;
26
+ gap: 12px;
27
+ color: t.color('on-surface-variant');
28
+ @include m.motion-transition(all);
29
+
30
+ &-icon {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: 24px;
35
+ height: 24px;
36
+ color: inherit;
37
+ border-radius: 50%;
38
+ padding: 8px;
39
+
40
+ svg {
41
+ width: 24px;
42
+ height: 24px;
43
+ fill: currentColor;
44
+ }
45
+ }
46
+
47
+ &--active {
48
+ color: t.color('primary');
49
+ }
50
+
51
+ &-label {
52
+ @include m.typography('label-large');
53
+ @include m.motion-transition(opacity);
54
+ }
55
+
56
+ &-badge {
57
+ position: absolute;
58
+ top: 8px;
59
+ right: 8px;
60
+ min-width: 16px;
61
+ height: 16px;
62
+ padding: 0 4px;
63
+ border-radius: 8px;
64
+ background-color: t.color('error');
65
+ color: t.color('on-error');
66
+ @include m.typography('label-small');
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ }
71
+ }
72
+
73
+ // Navigation positions
74
+ &--left {
75
+ left: 0;
76
+ }
77
+
78
+ &--right {
79
+ right: 0;
80
+ }
81
+
82
+ &--top {
83
+ top: 0;
84
+ }
85
+
86
+ &--bottom {
87
+ bottom: 0;
88
+ }
89
+
90
+ // States
91
+ &--disabled {
92
+ opacity: 0.38;
93
+ pointer-events: none;
94
+ }
95
+
96
+ // RTL Support
97
+ @include m.rtl {
98
+ &--left {
99
+ right: 0;
100
+ left: auto;
101
+ }
102
+
103
+ &--right {
104
+ left: 0;
105
+ right: auto;
106
+ }
107
+
108
+ .#{$component}-item {
109
+ &-badge {
110
+ right: auto;
111
+ left: 8px;
112
+ }
113
+ }
114
+ }
115
+
116
+ // Motion
117
+ @include m.reduced-motion {
118
+ &-item,
119
+ &-item-label {
120
+ transition: none;
121
+ }
122
+ }
123
+
124
+ // High contrast
125
+ @include m.high-contrast {
126
+ border: 1px solid currentColor;
127
+
128
+ &-item {
129
+ &--active {
130
+ outline: 2px solid currentColor;
131
+ outline-offset: -2px;
132
+ }
133
+ }
134
+ }
135
+
136
+ // BAR NAVIGATION
137
+ &--bar {
138
+ flex-direction: row;
139
+ width: 100%;
140
+ height: 80px;
141
+ padding: 0 12px;
142
+ justify-content: space-around;
143
+
144
+ .#{$component}-item {
145
+ flex: 1;
146
+ flex-direction: column;
147
+ height: 100%;
148
+ max-width: 168px;
149
+ gap: 4px;
150
+
151
+ &:hover {
152
+ .#{$component}-item-icon {
153
+ @include m.state-layer(t.color('on-surface'), 'hover');
154
+ }
155
+ }
156
+
157
+ &--active {
158
+ .#{$component}-item-icon {
159
+ background-color: t.color('secondary-container');
160
+ }
161
+ }
162
+
163
+ &-icon {
164
+ margin-bottom: 4px;
165
+ padding: 16px;
166
+ @include m.motion-transition(background-color);
167
+ }
168
+
169
+ &-label {
170
+ @include m.typography('label-medium');
171
+ text-align: center;
172
+ }
173
+
174
+ &-badge {
175
+ top: 4px;
176
+ right: 50%;
177
+ transform: translateX(12px);
178
+ }
179
+ }
180
+ }
181
+
182
+ // RAIL NAVIGATION
183
+ &--rail {
184
+ flex-direction: column;
185
+ width: 80px;
186
+ height: 100%;
187
+ padding: 12px 0;
188
+
189
+ .#{$component}-item {
190
+ flex-direction: column;
191
+ width: 100%;
192
+ min-height: 56px;
193
+ padding: 2px;
194
+ margin: -2px auto 14px;
195
+ gap: 0;
196
+
197
+ &:hover {
198
+ .#{$component}-item-icon {
199
+ @include m.state-layer(t.color('on-surface'), 'hover');
200
+ }
201
+ }
202
+
203
+ &--active {
204
+ .#{$component}-item-icon {
205
+ background-color: t.color('secondary-container');
206
+ }
207
+ }
208
+
209
+ &-icon {
210
+ margin-bottom: 4px;
211
+ padding: 8px;
212
+ width: 56px;
213
+ height: 32px;
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: center;
217
+ border-radius: 16px;
218
+ @include m.motion-transition(background-color);
219
+
220
+ svg {
221
+ width: 24px;
222
+ height: 24px;
223
+ fill: currentColor;
224
+ }
225
+ }
226
+
227
+ &-label {
228
+ @include m.typography('label-small');
229
+ text-align: center;
230
+ color: inherit;
231
+ font-size: 12px;
232
+ line-height: 16px;
233
+ }
234
+
235
+ &-badge {
236
+ top: 4px;
237
+ right: 16px;
238
+ }
239
+ }
240
+ }
241
+
242
+ // DRAWER NAVIGATION STYLES (BOTH MODAL AND STANDARD)
243
+ &--drawer,
244
+ &--drawer-modal,
245
+ &--drawer-standard {
246
+ flex-direction: column;
247
+ width: 256px;
248
+ height: 100%;
249
+ padding: 12px 0;
250
+ transition: transform v.motion('duration-short2') v.motion('easing-standard');
251
+ transform: translateX(0);
252
+ overflow-y: auto;
253
+
254
+ // Hidden state
255
+ &.#{$component}--hidden {
256
+ transform: translateX(-100%);
257
+
258
+ @include m.rtl {
259
+ transform: translateX(100%);
260
+ }
261
+ }
262
+
263
+ // Item container for nesting
264
+ .#{$component}-item-container {
265
+ width: 100%;
266
+ display: flex;
267
+ flex-direction: column;
268
+ }
269
+
270
+ // Base nav item styles
271
+ .#{$component}-item {
272
+ padding: 12px 16px;
273
+ align-items: center;
274
+ justify-content: flex-start;
275
+ border-radius: 28px;
276
+ margin: 0 12px;
277
+ width: calc(100% - 24px);
278
+
279
+ &:hover {
280
+ @include m.state-layer(t.color('on-surface'), 'hover');
281
+ }
282
+
283
+ &--active {
284
+ background-color: t.color('secondary-container');
285
+ color: t.color('on-secondary-container');
286
+
287
+ &:hover {
288
+ background-color: t.color('secondary-container');
289
+ }
290
+ }
291
+
292
+ &-icon {
293
+ margin-right: 12px;
294
+ flex-shrink: 0;
295
+ }
296
+
297
+ &-label {
298
+ @include m.typography('label-large');
299
+ flex-grow: 1;
300
+ text-align: left;
301
+ }
302
+
303
+ &-badge {
304
+ position: static;
305
+ margin-left: auto;
306
+ margin-right: 8px;
307
+ }
308
+ }
309
+
310
+ // Nested navigation styles
311
+ .#{$component}-nested-container {
312
+ display: flex;
313
+ flex-direction: column;
314
+ width: 100%;
315
+ margin-left: 28px;
316
+ padding-right: 12px;
317
+
318
+ &[hidden] {
319
+ display: none;
320
+ }
321
+
322
+ // Adjust nested items styles
323
+ .#{$component}-item {
324
+ margin: 0;
325
+ padding: 8px 16px;
326
+ font-size: 14px;
327
+
328
+ &-icon {
329
+ width: 20px;
330
+ height: 20px;
331
+ padding: 6px;
332
+
333
+ svg {
334
+ width: 20px;
335
+ height: 20px;
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ // Expand icon styles
342
+ .#{$component}-expand-icon {
343
+ display: flex;
344
+ align-items: center;
345
+ justify-content: center;
346
+ width: 20px;
347
+ height: 20px;
348
+ margin-left: auto;
349
+ color: inherit;
350
+ @include m.motion-transition(transform);
351
+
352
+ svg {
353
+ width: 20px;
354
+ height: 20px;
355
+ fill: none;
356
+ stroke: currentColor;
357
+ stroke-width: 2px;
358
+ }
359
+ }
360
+
361
+ // RTL support
362
+ @include m.rtl {
363
+ .#{$component}-item {
364
+ &-icon {
365
+ margin-right: 0;
366
+ margin-left: 12px;
367
+ }
368
+
369
+ &-label {
370
+ text-align: right;
371
+ }
372
+
373
+ &-badge {
374
+ margin-left: 8px;
375
+ margin-right: auto;
376
+ }
377
+ }
378
+
379
+ .#{$component}-nested-container {
380
+ margin-left: 0;
381
+ margin-right: 28px;
382
+ padding-right: 0;
383
+ padding-left: 12px;
384
+ }
385
+
386
+ .#{$component}-expand-icon {
387
+ margin-left: 0;
388
+ margin-right: auto;
389
+ transform: scaleX(-1);
390
+ }
391
+ }
392
+ }
393
+
394
+ // Specific drawer variants
395
+ &--drawer-modal {
396
+ @include m.elevation(2);
397
+ }
398
+
399
+ &--drawer-standard {
400
+ border-right: 1px solid t.color('outline-variant');
401
+
402
+ @include m.rtl {
403
+ border-right: none;
404
+ border-left: 1px solid t.color('outline-variant');
405
+ }
406
+ }
407
+ }
@@ -0,0 +1,101 @@
1
+ // src/components/progress/_progress.scss - Canvas-based progress styles (no SVG dependency)
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
+ @use "sass:math";
8
+
9
+ $component: "#{base.$prefix}-progress";
10
+
11
+ .#{$component} {
12
+ // Base container styles
13
+ position: relative;
14
+ display: block;
15
+ overflow: hidden;
16
+ transition: opacity 0.1s ease-in-out;
17
+ // Common accessibility attributes
18
+ &[aria-disabled="true"] {
19
+ opacity: 0.38;
20
+ pointer-events: none;
21
+ }
22
+
23
+ .#{$component}[style*="display: none"] {
24
+ opacity: 0 !important;
25
+ transition: none !important;
26
+ }
27
+
28
+ // Canvas element - shared by both variants
29
+ &-canvas {
30
+ display: block;
31
+ width: 100%;
32
+ height: 100%;
33
+ max-width: 100%; // Prevent canvas from growing beyond container
34
+ box-sizing: border-box; // Include borders in width calculation
35
+ position: relative; // Ensure proper stacking context
36
+
37
+ // Smooth transitions for canvas transforms (used in animations)
38
+ transition: transform 0.3s ease;
39
+ }
40
+
41
+ // Linear progress variant
42
+ &--linear {
43
+ width: 100%;
44
+ margin: 0 4px;
45
+ // Allow overflow for label visibility
46
+ overflow: visible;
47
+ min-height: 20px; // Ensure enough height for label
48
+ padding-bottom: 20px; // Space for label below
49
+
50
+ // When label is present, ensure proper spacing
51
+ &:has(.#{$component}__label) {
52
+ margin-bottom: 8px;
53
+ }
54
+ }
55
+
56
+ // Circular progress variant
57
+ &--circular {
58
+ display: inline-flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ border-radius: 50%;
62
+ }
63
+
64
+ // Label element (created dynamically when showLabel is used)
65
+ &__label {
66
+ position: absolute;
67
+ font-size: 12px;
68
+ color: t.color("on-surface-variant");
69
+ white-space: nowrap;
70
+ transition: opacity 0.3s ease;
71
+ z-index: 1; // Ensure label is above canvas
72
+
73
+ // Position differently based on variant
74
+ .#{$component}--linear & {
75
+ position: absolute;
76
+ right: 0;
77
+ top: initial;
78
+ // Remove transform and background for below positioning
79
+ font-size: 11px;
80
+ color: t.color("on-surface-variant");
81
+ }
82
+
83
+ .#{$component}--circular & {
84
+ top: 50%;
85
+ left: 50%;
86
+ transform: translate(-50%, -50%);
87
+ font-weight: 500;
88
+ }
89
+ }
90
+
91
+ // Disabled state
92
+ &--disabled {
93
+ opacity: 0.38;
94
+ pointer-events: none;
95
+
96
+ // Disable animations when disabled
97
+ .#{$component}-canvas {
98
+ animation: none !important;
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,187 @@
1
+ // src/components/radios/_styles.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}-radios';
9
+
10
+ .#{$component} {
11
+ display: flex;
12
+ margin: 0;
13
+ padding: 0;
14
+
15
+ // Vertical layout (default)
16
+ &--vertical {
17
+ flex-direction: column;
18
+
19
+ .#{$component}-item {
20
+ margin-bottom: 12px;
21
+
22
+ &:last-child {
23
+ margin-bottom: 0;
24
+ }
25
+ }
26
+ }
27
+
28
+ // Horizontal layout
29
+ &--horizontal {
30
+ flex-direction: row;
31
+ flex-wrap: wrap;
32
+ align-items: flex-start;
33
+
34
+ .#{$component}-item {
35
+ margin-right: 16px;
36
+
37
+ &:last-child {
38
+ margin-right: 0;
39
+ }
40
+ }
41
+ }
42
+
43
+ // Disabled state
44
+ &--disabled {
45
+ opacity: 0.6;
46
+ pointer-events: none;
47
+ }
48
+
49
+ // Radio item
50
+ &-item {
51
+ position: relative;
52
+ display: inline-flex;
53
+ align-items: center;
54
+
55
+ &--disabled {
56
+ cursor: not-allowed;
57
+ opacity: 0.6;
58
+
59
+ .#{$component}-label {
60
+ cursor: not-allowed;
61
+ }
62
+ }
63
+ }
64
+
65
+ // Radio input
66
+ &-input {
67
+ position: absolute;
68
+ opacity: 0;
69
+ height: 0;
70
+ width: 0;
71
+ margin: 0;
72
+ padding: 0;
73
+
74
+ // Focus styles
75
+ &:focus ~ .#{$component}-label .#{$component}-ripple {
76
+ background-color: t.alpha('primary', 0.12);
77
+ }
78
+
79
+ // Checked styles
80
+ &:checked ~ .#{$component}-label {
81
+ .#{$component}-circle {
82
+ border-color: t.color('primary');
83
+ border-width: 1.5px;
84
+
85
+ &:after {
86
+ transform: translate(-50%, -50%) scale(1);
87
+ opacity: 1;
88
+ }
89
+ }
90
+ }
91
+
92
+ // Disabled styles
93
+ &:disabled ~ .#{$component}-label {
94
+ .#{$component}-circle {
95
+ border-color: t.alpha('on-surface', 0.38);
96
+
97
+ &:after {
98
+ background-color: t.alpha('on-surface', 0.38);
99
+ }
100
+ }
101
+
102
+ .#{$component}-text {
103
+ color: t.alpha('on-surface', 0.38);
104
+ }
105
+ }
106
+ }
107
+
108
+ // Radio label
109
+ &-label {
110
+ position: relative;
111
+ display: inline-flex;
112
+ align-items: center;
113
+ cursor: pointer;
114
+ padding: 8px 0;
115
+ height: 48px;
116
+
117
+ // Typography for label
118
+ @include m.typography('body-medium');
119
+
120
+ &--before {
121
+ flex-direction: row-reverse;
122
+
123
+ .#{$component}-text {
124
+ margin-right: 12px;
125
+ margin-left: 0;
126
+ }
127
+ }
128
+ }
129
+
130
+ // Radio control
131
+ &-control {
132
+ position: relative;
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ width: 40px;
137
+ height: 40px;
138
+ flex-shrink: 0;
139
+ }
140
+
141
+ // Radio circle
142
+ &-circle {
143
+ position: relative;
144
+ width: 20px;
145
+ height: 20px;
146
+ border: 1.5px solid t.color('outline');
147
+ border-radius: 50%;
148
+ box-sizing: border-box;
149
+ transition: border-color 0.2s ease;
150
+
151
+ &:after {
152
+ content: '';
153
+ position: absolute;
154
+ top: 50%;
155
+ left: 50%;
156
+ transform: translate(-50%, -50%) scale(0);
157
+ width: 12px;
158
+ height: 12px;
159
+ border-radius: 50%;
160
+ background-color: t.color('primary');
161
+ opacity: 0;
162
+ transition: transform 0.15s ease, opacity 0.15s ease;
163
+ }
164
+ }
165
+
166
+ // Ripple effect
167
+ &-ripple {
168
+ position: absolute;
169
+ top: 0;
170
+ left: 0;
171
+ right: 0;
172
+ bottom: 0;
173
+ border-radius: 50%;
174
+ transition: background-color 0.15s ease;
175
+
176
+ // Apply ripple effect on hover
177
+ .#{$component}-input:not(:disabled) ~ .#{$component}-label:hover & {
178
+ background-color: t.alpha('primary', 0.08);
179
+ }
180
+ }
181
+
182
+ // Radio text
183
+ &-text {
184
+ margin-left: 8px;
185
+ line-height: 1.2;
186
+ }
187
+ }