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,274 @@
1
+ // src/styles/components/_select.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}-select';
9
+
10
+ .#{$component} {
11
+ // Base styles - building on textfield base
12
+ position: relative;
13
+ width: 100%;
14
+ cursor: pointer;
15
+
16
+ // Transition
17
+ @include m.motion-transition(
18
+ border-color,
19
+ background-color,
20
+ box-shadow
21
+ );
22
+
23
+ // Ensure the textfield input works with our select
24
+ .#{base.$prefix}-textfield-input {
25
+ cursor: pointer;
26
+ pointer-events: none; // Let clicks pass through to the container
27
+ caret-color: transparent; // Hide text cursor since it's not editable
28
+ }
29
+
30
+ // Trailing icon (dropdown arrow)
31
+ .#{base.$prefix}-textfield-trailing-icon {
32
+ pointer-events: auto; // Allow clicks on the icon
33
+ cursor: pointer;
34
+ transform: translateY(-50%); // Keep vertical centering
35
+ transition: v.motion('duration-medium1') v.motion('easing-emphasized'); // Add transition for smooth rotation and color changes
36
+
37
+ svg {
38
+ width: 24px;
39
+ height: 24px;
40
+ vertical-align: middle;
41
+ color: inherit;
42
+ transition: v.motion('duration-medium1') v.motion('easing-emphasized'); // Add transition for the SVG itself
43
+ }
44
+ }
45
+
46
+ // State when menu is open
47
+ &--open {
48
+ z-index: 2; // Keep above other elements when open
49
+
50
+ // These styles handle the focused state when the menu is open
51
+ .#{base.$prefix}-textfield--filled {
52
+ &::before {
53
+ opacity: 1; // Show the active indicator
54
+ }
55
+
56
+ .#{base.$prefix}-textfield-label {
57
+ color: t.color('primary');
58
+ }
59
+
60
+ // Fix for filled variant positioning
61
+ .#{base.$prefix}-textfield-trailing-icon {
62
+ top: 28px; // Match the filled textfield's icon positioning
63
+ }
64
+ }
65
+
66
+ .#{base.$prefix}-textfield--outlined {
67
+ &::before {
68
+ opacity: 1;
69
+ border-color: t.color('primary');
70
+ }
71
+
72
+ .#{base.$prefix}-textfield-label {
73
+ color: t.color('primary');
74
+ }
75
+ }
76
+
77
+ // Apply rotation to SVG instead of the container for better positioning
78
+ .#{base.$prefix}-textfield-trailing-icon {
79
+ color: t.color('primary');
80
+
81
+ svg {
82
+ transform: rotate(180deg); // Rotate the SVG, not the container
83
+ }
84
+ }
85
+ }
86
+
87
+ // Disabled state
88
+ &--disabled {
89
+ pointer-events: none;
90
+ opacity: 0.38;
91
+ cursor: default;
92
+
93
+ .#{base.$prefix}-textfield-input,
94
+ .#{base.$prefix}-textfield-trailing-icon {
95
+ cursor: default;
96
+ }
97
+ }
98
+
99
+ // Error state
100
+ &--error {
101
+ .#{base.$prefix}-textfield-trailing-icon {
102
+ color: t.color('error');
103
+ }
104
+ }
105
+
106
+ // Menu styles specifically for select
107
+ & + .#{base.$prefix}-menu {
108
+ // Additional styles for the connected menu
109
+ max-height: 20rem;
110
+ overflow-y: auto;
111
+ max-width: initial;
112
+
113
+ .#{base.$prefix}-menu-item {
114
+ min-height: 3rem;
115
+
116
+ // Selected state
117
+ &--selected {
118
+ background-color: t.alpha('primary', 0.12);
119
+ color: t.color('primary');
120
+ font-weight: 500;
121
+
122
+ &::after {
123
+ content: "";
124
+ display: block;
125
+ position: absolute;
126
+ right: 12px;
127
+ width: 18px;
128
+ height: 18px;
129
+ // Use mask-image instead of background-image
130
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
131
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
132
+ mask-size: contain;
133
+ -webkit-mask-size: contain;
134
+ mask-repeat: no-repeat;
135
+ -webkit-mask-repeat: no-repeat;
136
+ mask-position: center;
137
+ -webkit-mask-position: center;
138
+ // Use currentColor to match the text color
139
+ background-color: currentColor;
140
+ }
141
+ }
142
+ }
143
+ }
144
+
145
+ // Size variants
146
+ &--small {
147
+ .#{base.$prefix}-textfield {
148
+ height: v.textfield('height-small');
149
+ }
150
+
151
+ .#{base.$prefix}-textfield-input {
152
+ height: v.textfield('height-small');
153
+ padding-top: 8px;
154
+ padding-bottom: 8px;
155
+ }
156
+ }
157
+
158
+ &--large {
159
+ .#{base.$prefix}-textfield {
160
+ height: v.textfield('height-large');
161
+ }
162
+
163
+ .#{base.$prefix}-textfield-input {
164
+ height: v.textfield('height-large');
165
+ padding-top: 16px;
166
+ padding-bottom: 16px;
167
+ }
168
+ }
169
+
170
+ // Variant adjustments
171
+ &--filled {
172
+ // Specific adjustments for filled variant
173
+ .#{base.$prefix}-textfield-label {
174
+ // Adjust label position for filled select
175
+ }
176
+ }
177
+
178
+ &--outlined {
179
+ // Specific adjustments for outlined variant
180
+ .#{base.$prefix}-textfield-label {
181
+ // Adjust label position for outlined select
182
+ }
183
+ }
184
+
185
+ // Focus styles
186
+ &:focus-within {
187
+ .#{base.$prefix}-textfield-trailing-icon {
188
+ color: t.color('primary');
189
+ }
190
+ }
191
+
192
+ // Helper text positioning
193
+ .#{base.$prefix}-textfield-helper {
194
+ margin-top: 4px;
195
+ }
196
+ }
197
+
198
+ // Specific styles for the menu when used with select
199
+ .#{base.$prefix}-select-menu {
200
+ margin-top: 4px;
201
+ max-height: 300px;
202
+ overflow-y: auto;
203
+ max-width: 460px;
204
+
205
+ // .#{base.$prefix}-menu-list {
206
+ // padding: 8px 0;
207
+ // }
208
+
209
+ // .#{base.$prefix}-menu-item {
210
+ // padding: 0 16px;
211
+ // height: 48px;
212
+ // display: flex;
213
+ // align-items: center;
214
+ // position: relative;
215
+
216
+ // &--selected {
217
+ // color: t.color('primary');
218
+ // font-weight: 500;
219
+ // }
220
+
221
+ // &-icon {
222
+ // margin-right: 16px;
223
+ // display: flex;
224
+ // align-items: center;
225
+
226
+ // svg {
227
+ // width: 18px;
228
+ // height: 18px;
229
+ // }
230
+ // }
231
+
232
+ // &-text {
233
+ // flex: 1;
234
+ // @include m.truncate;
235
+ // }
236
+ // }
237
+
238
+ // .#{base.$prefix}-menu-divider {
239
+ // height: 1px;
240
+ // margin: 8px 0;
241
+ // background-color: t.color('outline-variant');
242
+ // }
243
+ }
244
+
245
+ // Animation for the menu
246
+ @keyframes select-menu-fade-in {
247
+ from {
248
+ opacity: 0;
249
+ transform: translateY(-8px);
250
+ }
251
+ to {
252
+ opacity: 1;
253
+ transform: translateY(0);
254
+ }
255
+ }
256
+
257
+ @keyframes select-menu-fade-out {
258
+ from {
259
+ opacity: 1;
260
+ transform: translateY(0);
261
+ }
262
+ to {
263
+ opacity: 0;
264
+ transform: translateY(-8px);
265
+ }
266
+ }
267
+
268
+ .#{base.$prefix}-select-menu--visible {
269
+ animation: select-menu-fade-in 0.2s ease forwards;
270
+ }
271
+
272
+ .#{base.$prefix}-select-menu--hiding {
273
+ animation: select-menu-fade-out 0.2s ease forwards;
274
+ }
@@ -0,0 +1,236 @@
1
+ // src/components/sheet/_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}-sheet';
9
+
10
+ .#{$component} {
11
+ // Base styles
12
+ position: fixed;
13
+ z-index: 1000;
14
+ display: flex;
15
+ flex-direction: column;
16
+ background-color: t.color('surface');
17
+ transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
18
+ overflow: hidden;
19
+
20
+ // Common elevated surface styling
21
+ border-radius: 12px 12px 0 0;
22
+ box-sizing: border-box;
23
+ max-width: 100%;
24
+ max-height: 100%;
25
+
26
+ // Initially hidden
27
+ opacity: 0;
28
+ pointer-events: none;
29
+
30
+ // Typography for content
31
+ @include m.typography('body-medium');
32
+
33
+ // Scrim (background overlay)
34
+ &-scrim {
35
+ position: fixed;
36
+ top: 0;
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ background-color: t.alpha('scrim', 0.32);
41
+ z-index: 999;
42
+ opacity: 0;
43
+ transition: opacity 0.3s ease-in-out;
44
+ pointer-events: none;
45
+ }
46
+
47
+ &--open {
48
+ opacity: 1;
49
+ pointer-events: auto;
50
+
51
+ + .#{$component}-scrim {
52
+ opacity: 1;
53
+ pointer-events: auto;
54
+ }
55
+ }
56
+
57
+ // Drag handle
58
+ &-handle {
59
+ width: 32px;
60
+ height: 4px;
61
+ border-radius: 2px;
62
+ background-color: t.color('outline-variant');
63
+ margin: 8px auto;
64
+ cursor: grab;
65
+
66
+ &:active {
67
+ cursor: grabbing;
68
+ }
69
+ }
70
+
71
+ // Title area
72
+ &-title {
73
+ padding: 16px 24px 0;
74
+ @include m.typography('headline-small');
75
+ color: t.color('on-surface');
76
+ }
77
+
78
+ // Content container
79
+ &-content {
80
+ padding: 16px 24px 24px;
81
+ overflow-y: auto;
82
+ flex: 1;
83
+ // Ensure a min-height for small content
84
+ min-height: 32px;
85
+ }
86
+
87
+ // Position variants
88
+ &--bottom {
89
+ bottom: 0;
90
+ left: 0;
91
+ right: 0;
92
+ transform: translateY(100%);
93
+ border-radius: 28px 28px 0 0;
94
+
95
+ &.#{$component}--open {
96
+ transform: translateY(0);
97
+ }
98
+ }
99
+
100
+ &--top {
101
+ top: 0;
102
+ left: 0;
103
+ right: 0;
104
+ transform: translateY(-100%);
105
+ border-radius: 0 0 28px 28px;
106
+
107
+ &.#{$component}--open {
108
+ transform: translateY(0);
109
+ }
110
+
111
+ .#{$component}-handle {
112
+ margin: 0 auto 8px;
113
+ }
114
+ }
115
+
116
+ &--left {
117
+ top: 0;
118
+ bottom: 0;
119
+ left: 0;
120
+ transform: translateX(-100%);
121
+ border-radius: 0 28px 28px 0;
122
+
123
+ &.#{$component}--open {
124
+ transform: translateX(0);
125
+ }
126
+
127
+ .#{$component}-handle {
128
+ width: 4px;
129
+ height: 32px;
130
+ margin: auto 8px auto auto;
131
+ }
132
+ }
133
+
134
+ &--right {
135
+ top: 0;
136
+ bottom: 0;
137
+ right: 0;
138
+ transform: translateX(100%);
139
+ border-radius: 28px 0 0 28px;
140
+
141
+ &.#{$component}--open {
142
+ transform: translateX(0);
143
+ }
144
+
145
+ .#{$component}-handle {
146
+ width: 4px;
147
+ height: 32px;
148
+ margin: auto auto auto 8px;
149
+ }
150
+ }
151
+
152
+ // Variant styles
153
+ &--standard {
154
+ // Apply different elevation based on position
155
+ &.#{$component}--bottom,
156
+ &.#{$component}--top {
157
+ width: 100%;
158
+ max-width: 640px;
159
+ margin: 0 auto;
160
+ @include m.elevation(3);
161
+ }
162
+
163
+ &.#{$component}--left,
164
+ &.#{$component}--right {
165
+ max-width: 360px;
166
+ width: 90%;
167
+ @include m.elevation(3);
168
+ }
169
+ }
170
+
171
+ &--modal {
172
+ // Modal variant has higher elevation and a required scrim
173
+ @include m.elevation(5);
174
+
175
+ &.#{$component}--bottom,
176
+ &.#{$component}--top {
177
+ width: 100%;
178
+ max-width: 560px;
179
+ margin: 0 auto;
180
+ }
181
+
182
+ &.#{$component}--left,
183
+ &.#{$component}--right {
184
+ max-width: 320px;
185
+ width: 90%;
186
+ }
187
+
188
+ + .#{$component}-scrim {
189
+ background-color: t.alpha('scrim', 0.5);
190
+ }
191
+ }
192
+
193
+ &--expanded {
194
+ // Full screen variant
195
+ &.#{$component}--bottom,
196
+ &.#{$component}--top {
197
+ height: 100%;
198
+ max-height: calc(100% - 24px);
199
+ width: 100%;
200
+ }
201
+
202
+ &.#{$component}--left,
203
+ &.#{$component}--right {
204
+ width: 100%;
205
+ max-width: 100%;
206
+ }
207
+ }
208
+
209
+ // States
210
+ &--dismissible {
211
+ .#{$component}-scrim {
212
+ cursor: pointer;
213
+ }
214
+ }
215
+
216
+ // Elevation levels (1-5)
217
+ &--elevation-1 {
218
+ @include m.elevation(1);
219
+ }
220
+
221
+ &--elevation-2 {
222
+ @include m.elevation(2);
223
+ }
224
+
225
+ &--elevation-3 {
226
+ @include m.elevation(3);
227
+ }
228
+
229
+ &--elevation-4 {
230
+ @include m.elevation(4);
231
+ }
232
+
233
+ &--elevation-5 {
234
+ @include m.elevation(5);
235
+ }
236
+ }