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,264 @@
1
+ // src/components/slider/_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
+ // Define the transition properties for smoother animations with absolute positioning
9
+ $handle-transition: left 0.225s cubic-bezier(0.4, 0, 0.2, 1), transform 0.225s cubic-bezier(0.4, 0, 0.2, 1);
10
+ $bubble-transition: left 0.225s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.225s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.225s;
11
+ $bubble-transition-visible: left 0.225s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.225s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
12
+
13
+ $component: '#{base.$prefix}-slider';
14
+
15
+ .#{$component} {
16
+ // Base styles
17
+ position: relative;
18
+ width: 100%;
19
+ display: flex;
20
+ flex-direction: column;
21
+ user-select: none;
22
+ touch-action: none;
23
+
24
+ // Container should not have a focus outline
25
+ &:focus {
26
+ outline: none;
27
+ }
28
+
29
+ // Label styles
30
+ &-label {
31
+ display: block;
32
+ font-size: 18px;
33
+ font-weight: 400;
34
+ color: t.color('on-surface');
35
+ margin-bottom: 4px;
36
+ }
37
+
38
+ // Icon positioning
39
+ &-icon {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ color: t.color('on-surface-variant');
44
+ position: absolute;
45
+ width: 40px;
46
+ height: 40px;
47
+ top: 16px;
48
+
49
+ svg {
50
+ width: 24px;
51
+ height: 24px;
52
+ }
53
+ }
54
+
55
+ // When slider has icon at end position
56
+ &--icon {
57
+ .#{$component}-label {
58
+ margin-left: 48px;
59
+ }
60
+
61
+ .#{$component}-container {
62
+ margin-left: 48px;
63
+ }
64
+ }
65
+
66
+ // Slider container - holds all the slider elements
67
+ &-container {
68
+ position: relative;
69
+ height: 40px;
70
+ display: flex;
71
+ align-items: center;
72
+ }
73
+
74
+ // Canvas element for hybrid rendering
75
+ &-canvas {
76
+ position: absolute !important;
77
+ top: 0;
78
+ left: 0;
79
+ width: 100% !important;
80
+ height: 100% !important;
81
+ pointer-events: none;
82
+ z-index: 0;
83
+ }
84
+
85
+ // Handle - updated with T-shape and proper focus styles
86
+ &-handle {
87
+ position: absolute;
88
+ top: 50%;
89
+ transform: translate(-50%, -50%);
90
+ cursor: pointer;
91
+ z-index: 4;
92
+ padding: 4px 0;
93
+ transition: $handle-transition;
94
+ width: 14px;
95
+ height: 50px;
96
+ border-radius: 16px;
97
+ background-color: rgba(red, .0);
98
+
99
+ // Focus styles for keyboard navigation
100
+ &:focus {
101
+ outline: 2px solid t.color('outline');
102
+ }
103
+
104
+ // Class added when focused via keyboard
105
+ &--focused {
106
+ // Additional styling when focused
107
+ }
108
+
109
+ // Create a T-shaped handle using pseudo-elements
110
+ &::before {
111
+ pointer-events: none;
112
+ content: '';
113
+ position: absolute;
114
+ width: 4px;
115
+ height: calc(100% - 8px);
116
+ background-color: t.color('primary');
117
+ border-radius: 2px;
118
+ left: 50%;
119
+ top: 50%;
120
+ transform: translate(-50%, -50%);
121
+ transition: background-color 0.15s ease, opacity 0.15s ease, width 0.15s ease;
122
+
123
+ .#{$component}--secondary & {
124
+ background-color: t.color('secondary');
125
+ }
126
+
127
+ .#{$component}--tertiary & {
128
+ background-color: t.color('tertiary');
129
+ }
130
+
131
+ .#{$component}--error & {
132
+ background-color: t.color('error');
133
+ }
134
+
135
+ .#{$component}--disabled & {
136
+ background-color: t.color('on-surface');
137
+ opacity: 0.38;
138
+ }
139
+ }
140
+
141
+ // Disabled pointer events on the pseudo-element
142
+ &::before {
143
+ pointer-events: none;
144
+ }
145
+
146
+ // Make handle line slimmer during dragging (feedback)
147
+ .#{$component}--dragging & {
148
+ &::before {
149
+ width: 3px;
150
+ }
151
+ }
152
+
153
+ // Hover state
154
+ &:hover::before {
155
+ background-color: t.color('primary');
156
+
157
+ .#{$component}--secondary & {
158
+ background-color: t.color('secondary');
159
+ }
160
+
161
+ .#{$component}--tertiary & {
162
+ background-color: t.color('tertiary');
163
+ }
164
+
165
+ .#{$component}--error & {
166
+ background-color: t.color('error');
167
+ }
168
+
169
+ .#{$component}--disabled & {
170
+ background-color: t.color('on-surface');
171
+ opacity: 0.38;
172
+ }
173
+ }
174
+
175
+ // Active state
176
+ &:active::before {
177
+ background-color: t.color('primary');
178
+ width: 3px; // Shrink width when active for visual feedback
179
+
180
+ .#{$component}--secondary & {
181
+ background-color: t.color('secondary');
182
+ }
183
+
184
+ .#{$component}--tertiary & {
185
+ background-color: t.color('tertiary');
186
+ }
187
+
188
+ .#{$component}--error & {
189
+ background-color: t.color('error');
190
+ }
191
+ }
192
+ }
193
+
194
+ // Range slider styles
195
+ &--range {
196
+ .#{$component}-handle {
197
+ &:nth-of-type(1) {
198
+ z-index: 3;
199
+ }
200
+ }
201
+
202
+ // In range mode, both dots should be visible
203
+ .#{$component}-dot {
204
+ z-index: 2;
205
+ }
206
+ }
207
+
208
+ // Value bubble - shows current value during interaction
209
+ &-value {
210
+ position: absolute;
211
+ top: -40px;
212
+ left: 0;
213
+ background-color: t.color('on-surface');
214
+ color: t.color('surface-container-highest');
215
+ padding: 6px 12px;
216
+ border-radius: 21px;
217
+ font-size: 14px;
218
+ font-weight: 600;
219
+ transform: translateX(-50%);
220
+ visibility: hidden;
221
+ opacity: 0;
222
+ transition: $bubble-transition;
223
+ pointer-events: none;
224
+
225
+ // Show value when interacting
226
+ &--visible {
227
+ visibility: visible;
228
+ opacity: 1;
229
+ transition: $bubble-transition-visible;
230
+ }
231
+ }
232
+
233
+ &--disabled {
234
+
235
+ // Disabled state
236
+ .#{$component}-handle {
237
+ cursor: default;
238
+ pointer-events: none;
239
+
240
+ &::before {
241
+ opacity: 0.38;
242
+ background-color: t.color('on-surface');
243
+ transition: background-color 0.15s ease, opacity 0.15s ease, width 0.15s ease;
244
+ }
245
+ }
246
+ }
247
+
248
+ // Discrete slider with steps
249
+ &--discrete {
250
+ .#{$component}-tick {
251
+ width: 4px;
252
+ height: 4px;
253
+ }
254
+ }
255
+
256
+ // For dragging state - visual feedback
257
+ &--dragging {
258
+ // No transitions during dragging for responsive feel
259
+ .#{$component}-handle,
260
+ .#{$component}-value {
261
+ transition: none;
262
+ }
263
+ }
264
+ }
@@ -0,0 +1,211 @@
1
+ // src/components/snackbar/_snackbar.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}-snackbar';
9
+
10
+ .#{$component} {
11
+ // Base styles following modern minimal design
12
+ @include m.typography('body-medium');
13
+ position: fixed;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: space-between;
17
+ min-width: 280px;
18
+ max-width: 480px;
19
+ padding: 14px 16px;
20
+ gap: 12px;
21
+
22
+ // Updated colors and appearance
23
+ background-color: rgba(32, 33, 36, 0.9);
24
+ color: rgb(255, 255, 255);
25
+ border-radius: f.get-shape('extra-small');
26
+ backdrop-filter: blur(8px);
27
+
28
+ // Animation setup - separated properties for better transitions
29
+ opacity: 0;
30
+ transform: translateY(20px);
31
+ transition:
32
+ opacity v.motion('duration-short2') v.motion('easing-standard'),
33
+ transform v.motion('duration-short2') v.motion('easing-standard');
34
+
35
+ // Using a fixed z-index since 'snackbar' isn't defined in z-index tokens
36
+ z-index: f.get-z-index('popover');
37
+ pointer-events: none;
38
+ will-change: transform, opacity;
39
+
40
+ @include m.elevation(2);
41
+
42
+ // Message text styles
43
+ &-text {
44
+ @include m.truncate(1);
45
+ flex: 1;
46
+ font-size: 14px;
47
+ line-height: 20px;
48
+ }
49
+
50
+ // Action button styles
51
+ &-action {
52
+ @include m.typography('label-large');
53
+ padding: 8px 12px;
54
+ margin: -8px -10px -8px -4px;
55
+ // margin-left: 4px;
56
+ color: rgb(138, 180, 248);
57
+ background: none;
58
+ border: none;
59
+ border-radius: f.get-shape('extra-small');
60
+ cursor: pointer;
61
+ font-weight: 500;
62
+ font-size: 14px;
63
+ text-transform: capitalize;
64
+ white-space: nowrap;
65
+ @include m.motion-transition(background-color);
66
+
67
+ &:hover {
68
+ background-color: rgba(138, 180, 248, 0.08);
69
+ }
70
+
71
+ &:focus-visible {
72
+ outline: 2px solid rgb(138, 180, 248);
73
+ outline-offset: 0px;
74
+ }
75
+
76
+ &:active {
77
+ background-color: rgba(138, 180, 248, 0.12);
78
+ }
79
+ }
80
+
81
+ // Positioning variants with corrected transforms
82
+ &--start {
83
+ bottom: 24px;
84
+ left: 24px;
85
+ transform: translateY(20px);
86
+
87
+ @include m.rtl {
88
+ left: auto;
89
+ right: 24px;
90
+ }
91
+
92
+ @include m.breakpoint-down('sm') {
93
+ left: 16px;
94
+ bottom: 16px;
95
+
96
+ @include m.rtl {
97
+ left: auto;
98
+ right: 16px;
99
+ }
100
+ }
101
+ }
102
+
103
+ &--center {
104
+ bottom: 24px;
105
+ left: 50%;
106
+ transform: translate(-50%, 20px);
107
+
108
+ @include m.breakpoint-down('sm') {
109
+ bottom: 16px;
110
+ width: calc(100% - 32px);
111
+ }
112
+ }
113
+
114
+ &--end {
115
+ bottom: 24px;
116
+ right: 24px;
117
+ transform: translateY(20px);
118
+
119
+ @include m.rtl {
120
+ right: auto;
121
+ left: 24px;
122
+ }
123
+
124
+ @include m.breakpoint-down('sm') {
125
+ right: 16px;
126
+ bottom: 16px;
127
+
128
+ @include m.rtl {
129
+ right: auto;
130
+ left: 16px;
131
+ }
132
+ }
133
+ }
134
+
135
+ // Visible state with corrected transforms
136
+ &--visible {
137
+ opacity: 1;
138
+ pointer-events: auto;
139
+
140
+ &.#{$component}--start,
141
+ &.#{$component}--end {
142
+ transform: translateY(0);
143
+ }
144
+
145
+ &.#{$component}--center {
146
+ transform: translate(-50%, 0);
147
+ }
148
+ }
149
+
150
+ // Multiple line variant
151
+ &--multiline {
152
+ padding-top: 14px;
153
+ padding-bottom: 14px;
154
+
155
+ .#{$component}-text {
156
+ @include m.truncate(2);
157
+ }
158
+ }
159
+
160
+ // Color variants
161
+ &--primary {
162
+ background-color: t.alpha('primary', 0.9);
163
+
164
+ .#{$component}-action {
165
+ color: t.color('on-primary');
166
+
167
+ &:hover {
168
+ background-color: t.alpha('on-primary', 0.08);
169
+ }
170
+
171
+ &:active {
172
+ background-color: t.alpha('on-primary', 0.12);
173
+ }
174
+
175
+ &:focus-visible {
176
+ outline-color: t.color('on-primary');
177
+ }
178
+ }
179
+ }
180
+
181
+ // Accessibility
182
+ @include m.reduced-motion {
183
+ transition: none;
184
+ transform: none;
185
+
186
+ &--visible {
187
+ transform: none;
188
+
189
+ &.#{$component}--center {
190
+ transform: translateX(-50%);
191
+ }
192
+ }
193
+ }
194
+
195
+ @include m.high-contrast {
196
+ outline: 2px solid currentColor;
197
+ background-color: black;
198
+ }
199
+
200
+ // Mobile optimizations
201
+ @include m.breakpoint-down('sm') {
202
+ min-width: auto;
203
+ max-width: none;
204
+ margin: 0 16px;
205
+ }
206
+
207
+ // Print styles
208
+ @include m.print {
209
+ display: none;
210
+ }
211
+ }