mtrl 0.5.2 → 0.5.3

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 (69) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/package.json +1 -1
  4. package/dist/styles.css +1 -1
  5. package/package.json +3 -2
  6. package/src/styles/abstract/_base.scss +2 -0
  7. package/src/styles/abstract/_config.scss +28 -0
  8. package/src/styles/abstract/_functions.scss +124 -0
  9. package/src/styles/abstract/_mixins.scss +401 -0
  10. package/src/styles/abstract/_theme.scss +269 -0
  11. package/src/styles/abstract/_variables.scss +338 -0
  12. package/src/styles/base/_reset.scss +86 -0
  13. package/src/styles/base/_typography.scss +155 -0
  14. package/src/styles/components/_badge.scss +183 -0
  15. package/src/styles/components/_bottom-app-bar.scss +103 -0
  16. package/src/styles/components/_button.scss +756 -0
  17. package/src/styles/components/_card.scss +401 -0
  18. package/src/styles/components/_carousel.scss +645 -0
  19. package/src/styles/components/_checkbox.scss +231 -0
  20. package/src/styles/components/_chips.scss +639 -0
  21. package/src/styles/components/_datepicker.scss +358 -0
  22. package/src/styles/components/_dialog.scss +259 -0
  23. package/src/styles/components/_divider.scss +57 -0
  24. package/src/styles/components/_extended-fab.scss +309 -0
  25. package/src/styles/components/_fab.scss +244 -0
  26. package/src/styles/components/_list.scss +774 -0
  27. package/src/styles/components/_menu.scss +245 -0
  28. package/src/styles/components/_navigation-mobile.scss +244 -0
  29. package/src/styles/components/_navigation-system.scss +151 -0
  30. package/src/styles/components/_navigation.scss +407 -0
  31. package/src/styles/components/_progress.scss +101 -0
  32. package/src/styles/components/_radios.scss +187 -0
  33. package/src/styles/components/_search.scss +306 -0
  34. package/src/styles/components/_segmented-button.scss +227 -0
  35. package/src/styles/components/_select.scss +274 -0
  36. package/src/styles/components/_sheet.scss +236 -0
  37. package/src/styles/components/_slider.scss +264 -0
  38. package/src/styles/components/_snackbar.scss +211 -0
  39. package/src/styles/components/_switch.scss +305 -0
  40. package/src/styles/components/_tabs.scss +421 -0
  41. package/src/styles/components/_textfield.scss +1024 -0
  42. package/src/styles/components/_timepicker.scss +451 -0
  43. package/src/styles/components/_tooltip.scss +241 -0
  44. package/src/styles/components/_top-app-bar.scss +225 -0
  45. package/src/styles/main.scss +129 -0
  46. package/src/styles/themes/_autumn.scss +105 -0
  47. package/src/styles/themes/_base-theme.scss +85 -0
  48. package/src/styles/themes/_baseline.scss +173 -0
  49. package/src/styles/themes/_bluekhaki.scss +125 -0
  50. package/src/styles/themes/_brownbeige.scss +125 -0
  51. package/src/styles/themes/_browngreen.scss +125 -0
  52. package/src/styles/themes/_forest.scss +77 -0
  53. package/src/styles/themes/_greenbeige.scss +125 -0
  54. package/src/styles/themes/_index.scss +19 -0
  55. package/src/styles/themes/_material.scss +125 -0
  56. package/src/styles/themes/_ocean.scss +77 -0
  57. package/src/styles/themes/_sageivory.scss +125 -0
  58. package/src/styles/themes/_spring.scss +77 -0
  59. package/src/styles/themes/_summer.scss +87 -0
  60. package/src/styles/themes/_sunset.scss +60 -0
  61. package/src/styles/themes/_tealcaramel.scss +125 -0
  62. package/src/styles/themes/_winter.scss +77 -0
  63. package/src/styles/utilities/_colors.scss +154 -0
  64. package/src/styles/utilities/_flexbox.scss +194 -0
  65. package/src/styles/utilities/_layout.scss +665 -0
  66. package/src/styles/utilities/_ripple.scss +79 -0
  67. package/src/styles/utilities/_spacing.scss +139 -0
  68. package/src/styles/utilities/_typography.scss +178 -0
  69. package/src/styles/utilities/_visibility.scss +142 -0
@@ -0,0 +1,645 @@
1
+ // src/components/carousel/_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}-carousel';
9
+
10
+ // Layout size adjustments
11
+ $large-item-width-multi-browse: 240px;
12
+ $medium-item-width-multi-browse: 180px;
13
+ $small-item-width-multi-browse: 48px;
14
+
15
+ $large-item-width-hero: 300px;
16
+ $small-item-width-hero: 48px;
17
+
18
+ .#{$component} {
19
+ // Base styles
20
+ position: relative;
21
+ width: 100%;
22
+ overflow: hidden;
23
+ user-select: none;
24
+ padding: 8px 0;
25
+ outline: none;
26
+
27
+ // Focus styles
28
+ &:focus {
29
+ outline: none;
30
+ }
31
+
32
+ &:focus-visible {
33
+ outline: 2px solid t.color('outline');
34
+ outline-offset: 2px;
35
+ }
36
+
37
+ // Layout specific styles
38
+ &-layout {
39
+ &--multi-browse {
40
+ // Multi-browse layout with different sized items
41
+ .#{$component}-slides {
42
+ scroll-snap-type: x mandatory;
43
+ padding: 0 16px;
44
+ }
45
+
46
+ .#{$component}-slide {
47
+ height: 320px;
48
+
49
+ &--large {
50
+ width: $large-item-width-multi-browse;
51
+ flex: 0 0 auto;
52
+ }
53
+
54
+ &--medium {
55
+ width: $medium-item-width-multi-browse;
56
+ flex: 0 0 auto;
57
+ }
58
+
59
+ &--small {
60
+ width: $small-item-width-multi-browse;
61
+ flex: 0 0 auto;
62
+ }
63
+ }
64
+ }
65
+
66
+ &--uncontained {
67
+ // Uncontained layout with uniform sized items
68
+ overflow: visible;
69
+
70
+ .#{$component}-slides {
71
+ scroll-snap-type: none;
72
+ padding: 0 16px;
73
+ }
74
+
75
+ .#{$component}-slide {
76
+ width: 240px;
77
+ height: 320px;
78
+ flex: 0 0 auto;
79
+ }
80
+ }
81
+
82
+ &--hero {
83
+ // Hero layout with one large item and smaller previews
84
+ .#{$component}-slides {
85
+ scroll-snap-type: x mandatory;
86
+ padding: 0 16px;
87
+ }
88
+
89
+ .#{$component}-slide {
90
+ height: 360px;
91
+
92
+ &--large {
93
+ width: $large-item-width-hero;
94
+ flex: 0 0 auto;
95
+ }
96
+
97
+ &--small {
98
+ width: $small-item-width-hero;
99
+ flex: 0 0 auto;
100
+ }
101
+ }
102
+
103
+ // Center-aligned hero
104
+ &[data-centered="true"] {
105
+ .#{$component}-slides {
106
+ padding: 0;
107
+ justify-content: center;
108
+ }
109
+
110
+ .#{$component}-slide--large {
111
+ margin: 0 16px;
112
+ }
113
+ }
114
+ }
115
+
116
+ &--full-screen {
117
+ // Full-screen layout for immersive experiences
118
+ height: 100%;
119
+ max-height: 100vh;
120
+ padding: 0;
121
+
122
+ .#{$component}-wrapper {
123
+ height: 100%;
124
+ }
125
+
126
+ .#{$component}-slides {
127
+ height: 100%;
128
+ flex-direction: column;
129
+ scroll-snap-type: y mandatory;
130
+ padding: 0;
131
+ }
132
+
133
+ .#{$component}-slide {
134
+ width: 100%;
135
+ height: 100vh;
136
+ flex: 0 0 auto;
137
+ border-radius: 0 !important;
138
+ scroll-snap-align: start;
139
+
140
+ &-image {
141
+ height: 100%;
142
+ }
143
+
144
+ &-content {
145
+ position: absolute;
146
+ bottom: 0;
147
+ left: 0;
148
+ right: 0;
149
+ padding: 24px;
150
+ background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
151
+ color: #FFFFFF;
152
+ }
153
+
154
+ &-title {
155
+ font-size: 24px;
156
+ font-weight: 500;
157
+ margin-bottom: 8px;
158
+ }
159
+
160
+ &-description {
161
+ font-size: 16px;
162
+ margin-bottom: 16px;
163
+ }
164
+ }
165
+
166
+ // Hide show all link in full-screen mode
167
+ .#{$component}-show-all {
168
+ display: none;
169
+ }
170
+ }
171
+ }
172
+
173
+ // Scroll behavior
174
+ &[data-scroll-behavior="snap"] {
175
+ .#{$component}-slides {
176
+ scroll-snap-type: x mandatory;
177
+
178
+ &[data-vertical-scroll="true"] {
179
+ scroll-snap-type: y mandatory;
180
+ }
181
+ }
182
+
183
+ .#{$component}-slide {
184
+ scroll-snap-align: start;
185
+
186
+ &--active {
187
+ z-index: 1;
188
+ }
189
+ }
190
+ }
191
+
192
+ // Slides container
193
+ &-slides {
194
+ display: flex;
195
+ overflow-x: auto;
196
+ scroll-snap-type: none;
197
+ gap: 12px;
198
+ padding: 0 16px;
199
+ margin: 0 -16px;
200
+ -ms-overflow-style: none; // Hide scrollbar on IE/Edge
201
+ scrollbar-width: none; // Hide scrollbar on Firefox
202
+ scroll-behavior: smooth;
203
+
204
+ // Set gap dynamically from data attribute
205
+ &[data-gap] {
206
+ gap: attr(data-gap px);
207
+ }
208
+
209
+ // Hide scrollbar on Chrome/Safari
210
+ &::-webkit-scrollbar {
211
+ display: none;
212
+ }
213
+
214
+ // Force overscroll behavior to be auto (no bounce/elastic effect)
215
+ overscroll-behavior: auto;
216
+ -webkit-overflow-scrolling: auto; // Disable momentum scrolling on iOS
217
+
218
+ // Completely disable all scrolling effects and resistance
219
+ &[data-dragging="true"] {
220
+ * {
221
+ pointer-events: none;
222
+ }
223
+ }
224
+ }
225
+
226
+ // Individual slide
227
+ &-slide {
228
+ position: relative;
229
+ flex-shrink: 0;
230
+ width: 240px;
231
+ height: 320px;
232
+ overflow: hidden;
233
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
234
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
235
+ background-color: #FFFFFF;
236
+
237
+ // Set border radius dynamically from data attribute
238
+ &[data-border-radius] {
239
+ border-radius: attr(data-border-radius px);
240
+ }
241
+
242
+ // Default border radius
243
+ border-radius: 16px;
244
+
245
+ // Active state
246
+ &--active {
247
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
248
+ transform: translateY(-4px);
249
+ z-index: 1;
250
+ }
251
+
252
+ // Image container
253
+ &-image {
254
+ position: relative;
255
+ width: 100%;
256
+ height: 70%;
257
+ overflow: hidden;
258
+
259
+ // Ensure images cover the slide properly
260
+ img {
261
+ width: 100%;
262
+ height: 100%;
263
+ object-fit: cover;
264
+ transition: transform 0.2s ease;
265
+ }
266
+ }
267
+
268
+ // Content container
269
+ &-content {
270
+ padding: 8px 12px;
271
+ height: 30%;
272
+ display: flex;
273
+ flex-direction: column;
274
+ justify-content: space-between;
275
+ }
276
+
277
+ // Slide title
278
+ &-title {
279
+ position: absolute;
280
+ bottom: 16px;
281
+ left: 16px;
282
+ color: #FFFFFF;
283
+ font-size: 18px;
284
+ font-weight: 500;
285
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
286
+ z-index: 2;
287
+ pointer-events: none;
288
+
289
+ &.visually-hidden {
290
+ position: absolute;
291
+ width: 1px;
292
+ height: 1px;
293
+ padding: 0;
294
+ margin: -1px;
295
+ overflow: hidden;
296
+ clip: rect(0, 0, 0, 0);
297
+ white-space: nowrap;
298
+ border: 0;
299
+ }
300
+ }
301
+
302
+ // Slide description
303
+ &-description {
304
+ position: absolute;
305
+ bottom: 48px;
306
+ left: 16px;
307
+ color: #FFFFFF;
308
+ font-size: 14px;
309
+ max-width: 80%;
310
+ z-index: 2;
311
+ pointer-events: none;
312
+
313
+ &.visually-hidden {
314
+ position: absolute;
315
+ width: 1px;
316
+ height: 1px;
317
+ padding: 0;
318
+ margin: -1px;
319
+ overflow: hidden;
320
+ clip: rect(0, 0, 0, 0);
321
+ white-space: nowrap;
322
+ border: 0;
323
+ }
324
+ }
325
+
326
+ // Overlay for accent color
327
+ &-overlay {
328
+ position: absolute;
329
+ top: 0;
330
+ left: 0;
331
+ width: 100%;
332
+ height: 100%;
333
+ background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 100%);
334
+ opacity: 0.7;
335
+ pointer-events: none;
336
+ z-index: 1;
337
+ }
338
+
339
+ // Button for actions
340
+ &-button {
341
+ display: inline-block;
342
+ position: absolute;
343
+ bottom: 16px;
344
+ right: 16px;
345
+ color: #FFFFFF;
346
+ padding: 8px 16px;
347
+ border-radius: 20px;
348
+ text-decoration: none;
349
+ font-size: 14px;
350
+ font-weight: 500;
351
+ z-index: 2;
352
+ background-color: rgba(0, 0, 0, 0.6);
353
+
354
+ &:hover {
355
+ opacity: 0.9;
356
+ }
357
+ }
358
+
359
+ // Different sizes for multi-browse layout
360
+ &--large {
361
+ // Styles already set based on layout
362
+ }
363
+
364
+ &--medium {
365
+ // Medium items may show less detail
366
+ .#{$component}-slide-content {
367
+ padding: 6px 10px;
368
+ }
369
+
370
+ .#{$component}-slide-title {
371
+ font-size: 16px;
372
+ }
373
+
374
+ .#{$component}-slide-description {
375
+ font-size: 12px;
376
+ }
377
+ }
378
+
379
+ &--small {
380
+ // Small items are primarily visual with minimal text
381
+ .#{$component}-slide-content {
382
+ padding: 4px 8px;
383
+ }
384
+
385
+ // Handle text abbreviation for small items
386
+ .#{$component}-slide-title,
387
+ .#{$component}-slide-description {
388
+ font-size: 12px;
389
+ white-space: nowrap;
390
+ overflow: hidden;
391
+ text-overflow: ellipsis;
392
+ }
393
+
394
+ .#{$component}-slide-button {
395
+ padding: 4px 8px;
396
+ font-size: 12px;
397
+ }
398
+ }
399
+ }
400
+
401
+ // Show all link
402
+ &-show-all {
403
+ display: flex;
404
+ align-items: center;
405
+ justify-content: flex-end;
406
+ padding: 8px 16px;
407
+ cursor: pointer;
408
+ text-align: right;
409
+
410
+ span {
411
+ color: #1967D2; // Google blue
412
+ font-size: 16px;
413
+ font-weight: 500;
414
+ transition: color 0.2s ease;
415
+ }
416
+
417
+ &:hover {
418
+ span {
419
+ text-decoration: underline;
420
+ }
421
+ }
422
+
423
+ &:focus {
424
+ outline: none;
425
+ }
426
+
427
+ &:focus-visible {
428
+ outline: 2px solid t.color('outline');
429
+ outline-offset: 2px;
430
+ }
431
+ }
432
+
433
+ // Drag-related styles
434
+ &[data-swipe="true"] {
435
+ cursor: grab;
436
+ }
437
+
438
+ &[data-dragging="true"] {
439
+ cursor: grabbing;
440
+ }
441
+
442
+ // Add parallax effect for multi-browse layout
443
+ &[data-enable-parallax="true"] {
444
+ .#{$component}-slide-image img {
445
+ transition: transform 0.1s ease-out;
446
+ }
447
+ }
448
+
449
+ // Navigation elements (can be shown with a CSS class if needed)
450
+ &-navigation {
451
+ display: none;
452
+
453
+ &.visible {
454
+ display: flex;
455
+ position: absolute;
456
+ bottom: 16px;
457
+ left: 50%;
458
+ transform: translateX(-50%);
459
+ justify-content: center;
460
+ align-items: center;
461
+ gap: 8px;
462
+ z-index: 2;
463
+ }
464
+ }
465
+
466
+ // Responsive adjustments for different screen sizes
467
+ @media (max-width: 600px) {
468
+ // In compact windows, adjust multi-browse layout
469
+ &-layout--multi-browse {
470
+ .#{$component}-slide {
471
+ &--large {
472
+ width: 200px;
473
+ height: 280px;
474
+ }
475
+
476
+ &--medium {
477
+ width: 150px;
478
+ height: 280px;
479
+ }
480
+ }
481
+ }
482
+
483
+ // For hero layout, ensure good visibility on mobile
484
+ &-layout--hero {
485
+ .#{$component}-slide {
486
+ &--large {
487
+ width: 280px;
488
+ height: 320px;
489
+ }
490
+ }
491
+ }
492
+
493
+ // General mobile adjustments
494
+ &-slide {
495
+ &-title {
496
+ font-size: 16px;
497
+ }
498
+
499
+ &-description {
500
+ font-size: 12px;
501
+ bottom: 42px;
502
+ }
503
+ }
504
+
505
+ &-show-all {
506
+ padding: 6px 12px;
507
+
508
+ span {
509
+ font-size: 14px;
510
+ }
511
+ }
512
+ }
513
+
514
+ // Even smaller screens
515
+ @media (max-width: 360px) {
516
+ // Further compact layout for small screens
517
+ &-layout--multi-browse {
518
+ .#{$component}-slide {
519
+ &--large {
520
+ width: 160px;
521
+ height: 240px;
522
+ }
523
+
524
+ &--medium,
525
+ &--small {
526
+ width: 120px;
527
+ height: 240px;
528
+ }
529
+ }
530
+ }
531
+
532
+ &-layout--hero {
533
+ .#{$component}-slide {
534
+ &--large {
535
+ width: 240px;
536
+ height: 280px;
537
+ }
538
+ }
539
+ }
540
+
541
+ &-slide {
542
+ &-title {
543
+ font-size: 14px;
544
+ bottom: 12px;
545
+ left: 12px;
546
+ }
547
+
548
+ &-description {
549
+ font-size: 11px;
550
+ bottom: 36px;
551
+ left: 12px;
552
+ }
553
+
554
+ &-button {
555
+ bottom: 12px;
556
+ right: 12px;
557
+ padding: 6px 12px;
558
+ font-size: 12px;
559
+ }
560
+ }
561
+
562
+ &-show-all {
563
+ padding: 4px 10px;
564
+
565
+ span {
566
+ font-size: 13px;
567
+ }
568
+ }
569
+ }
570
+
571
+ // Print styles
572
+ @media print {
573
+ overflow: visible;
574
+
575
+ &-slides {
576
+ display: grid;
577
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
578
+ gap: 16px;
579
+ overflow: visible;
580
+ }
581
+
582
+ &-slide {
583
+ page-break-inside: avoid;
584
+ break-inside: avoid;
585
+ }
586
+
587
+ &-show-all,
588
+ &-navigation {
589
+ display: none; /* Hide navigation and show all for print */
590
+ }
591
+ }
592
+
593
+ // RTL support
594
+ [dir="rtl"] & {
595
+ .#{$component}-slides {
596
+ direction: rtl;
597
+ }
598
+
599
+ .#{$component}-slide {
600
+ &-title {
601
+ left: auto;
602
+ right: 16px;
603
+ }
604
+
605
+ &-description {
606
+ left: auto;
607
+ right: 16px;
608
+ }
609
+
610
+ &-button {
611
+ right: auto;
612
+ left: 16px;
613
+ }
614
+ }
615
+
616
+ .#{$component}-show-all {
617
+ justify-content: flex-start;
618
+ }
619
+ }
620
+
621
+ // Animation for parallax effect
622
+ @keyframes slide-in {
623
+ 0% {
624
+ opacity: 0;
625
+ transform: translateX(30px);
626
+ }
627
+ 100% {
628
+ opacity: 1;
629
+ transform: translateX(0);
630
+ }
631
+ }
632
+
633
+ // Accessibility classes for text that should be visually hidden
634
+ .visually-hidden {
635
+ position: absolute;
636
+ width: 1px;
637
+ height: 1px;
638
+ padding: 0;
639
+ margin: -1px;
640
+ overflow: hidden;
641
+ clip: rect(0, 0, 0, 0);
642
+ white-space: nowrap;
643
+ border: 0;
644
+ }
645
+ }