mtrl 0.2.7 → 0.2.9

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 (190) hide show
  1. package/index.ts +2 -0
  2. package/package.json +14 -3
  3. package/src/components/badge/api.ts +23 -14
  4. package/src/components/badge/badge.ts +2 -2
  5. package/src/components/badge/config.ts +10 -11
  6. package/src/components/badge/features.ts +15 -10
  7. package/src/components/badge/index.ts +27 -2
  8. package/src/components/badge/types.ts +28 -8
  9. package/src/components/bottom-app-bar/bottom-app-bar.ts +2 -44
  10. package/src/components/bottom-app-bar/config.ts +1 -45
  11. package/src/components/bottom-app-bar/index.ts +7 -1
  12. package/src/components/bottom-app-bar/types.ts +7 -1
  13. package/src/components/button/button.ts +0 -1
  14. package/src/components/button/config.ts +1 -2
  15. package/src/components/button/index.ts +10 -2
  16. package/src/components/button/types.ts +14 -2
  17. package/src/components/card/config.ts +17 -9
  18. package/src/components/card/content.ts +8 -10
  19. package/src/components/card/features.ts +4 -6
  20. package/src/components/card/index.ts +29 -2
  21. package/src/components/card/types.ts +6 -23
  22. package/src/components/checkbox/config.ts +3 -4
  23. package/src/components/checkbox/index.ts +1 -2
  24. package/src/components/checkbox/types.ts +12 -3
  25. package/src/components/chip/api.ts +170 -221
  26. package/src/components/chip/chip.ts +34 -302
  27. package/src/components/chip/config.ts +1 -2
  28. package/src/components/chip/index.ts +10 -2
  29. package/src/components/chip/types.ts +224 -35
  30. package/src/components/datepicker/api.ts +18 -25
  31. package/src/components/datepicker/config.ts +9 -12
  32. package/src/components/datepicker/datepicker.ts +7 -12
  33. package/src/components/datepicker/index.ts +10 -7
  34. package/src/components/datepicker/render.ts +16 -18
  35. package/src/components/datepicker/types.ts +164 -35
  36. package/src/components/datepicker/utils.ts +1 -2
  37. package/src/components/dialog/api.ts +7 -8
  38. package/src/components/dialog/config.ts +3 -4
  39. package/src/components/dialog/features.ts +56 -22
  40. package/src/components/dialog/index.ts +38 -8
  41. package/src/components/dialog/types.ts +33 -10
  42. package/src/components/divider/index.ts +5 -1
  43. package/src/components/extended-fab/config.ts +6 -2
  44. package/src/components/extended-fab/index.ts +7 -2
  45. package/src/components/extended-fab/types.ts +21 -4
  46. package/src/components/fab/config.ts +3 -4
  47. package/src/components/fab/fab.ts +1 -1
  48. package/src/components/fab/index.ts +7 -2
  49. package/src/components/fab/types.ts +21 -4
  50. package/src/components/list/config.ts +4 -5
  51. package/src/components/list/features.ts +6 -7
  52. package/src/components/list/index.ts +7 -9
  53. package/src/components/list/list-item.ts +12 -13
  54. package/src/components/list/types.ts +50 -5
  55. package/src/components/list/utils.ts +30 -3
  56. package/src/components/menu/features/items-manager.ts +9 -9
  57. package/src/components/menu/features/positioning.ts +7 -7
  58. package/src/components/menu/features/visibility.ts +7 -7
  59. package/src/components/menu/index.ts +7 -9
  60. package/src/components/menu/menu-item.ts +6 -6
  61. package/src/components/menu/menu.ts +22 -0
  62. package/src/components/menu/types.ts +29 -10
  63. package/src/components/menu/utils.ts +67 -0
  64. package/src/components/navigation/api.ts +131 -96
  65. package/src/components/navigation/config.ts +22 -10
  66. package/src/components/navigation/features/controller.ts +273 -0
  67. package/src/components/navigation/features/items.ts +160 -87
  68. package/src/components/navigation/index.ts +0 -6
  69. package/src/components/navigation/nav-item.ts +12 -24
  70. package/src/components/navigation/navigation.ts +21 -8
  71. package/src/components/navigation/system-types.ts +124 -0
  72. package/src/components/navigation/system.ts +776 -0
  73. package/src/components/navigation/types.ts +228 -203
  74. package/src/components/progress/api.ts +2 -3
  75. package/src/components/progress/config.ts +2 -3
  76. package/src/components/progress/index.ts +0 -1
  77. package/src/components/progress/progress.ts +1 -2
  78. package/src/components/progress/types.ts +186 -33
  79. package/src/components/radios/config.ts +1 -1
  80. package/src/components/radios/index.ts +0 -1
  81. package/src/components/radios/types.ts +0 -7
  82. package/src/components/search/config.ts +1 -2
  83. package/src/components/search/features/search.ts +14 -15
  84. package/src/components/search/features/states.ts +5 -1
  85. package/src/components/search/features/structure.ts +3 -4
  86. package/src/components/search/index.ts +0 -3
  87. package/src/components/search/types.ts +18 -6
  88. package/src/components/segmented-button/config.ts +20 -7
  89. package/src/components/segmented-button/segment.ts +6 -7
  90. package/src/components/segmented-button/segmented-button.ts +4 -5
  91. package/src/components/segmented-button/types.ts +37 -2
  92. package/src/components/slider/config.ts +20 -2
  93. package/src/components/slider/features/controller.ts +761 -0
  94. package/src/components/slider/features/handlers.ts +18 -15
  95. package/src/components/slider/features/index.ts +3 -2
  96. package/src/components/slider/features/range.ts +104 -0
  97. package/src/components/slider/slider.ts +34 -14
  98. package/src/components/slider/structure.ts +152 -0
  99. package/src/components/slider/types.ts +34 -8
  100. package/src/components/snackbar/config.ts +2 -3
  101. package/src/components/snackbar/constants.ts +0 -32
  102. package/src/components/snackbar/index.ts +0 -1
  103. package/src/components/snackbar/position.ts +9 -1
  104. package/src/components/snackbar/types.ts +122 -46
  105. package/src/components/switch/config.ts +2 -3
  106. package/src/components/switch/index.ts +0 -1
  107. package/src/components/switch/types.ts +3 -2
  108. package/src/components/tabs/config.ts +3 -4
  109. package/src/components/tabs/index.ts +0 -15
  110. package/src/components/tabs/tab-api.ts +12 -4
  111. package/src/components/tabs/tab.ts +18 -6
  112. package/src/components/tabs/types.ts +13 -3
  113. package/src/components/textfield/api.ts +53 -0
  114. package/src/components/textfield/config.ts +2 -3
  115. package/src/components/textfield/features.ts +322 -0
  116. package/src/components/textfield/index.ts +0 -1
  117. package/src/components/textfield/textfield.ts +8 -0
  118. package/src/components/textfield/types.ts +29 -6
  119. package/src/components/timepicker/api.ts +1 -1
  120. package/src/components/timepicker/clockdial.ts +2 -5
  121. package/src/components/timepicker/config.ts +102 -4
  122. package/src/components/timepicker/index.ts +1 -6
  123. package/src/components/timepicker/render.ts +1 -1
  124. package/src/components/timepicker/timepicker.ts +1 -1
  125. package/src/components/tooltip/api.ts +1 -1
  126. package/src/components/tooltip/config.ts +27 -6
  127. package/src/components/tooltip/index.ts +0 -1
  128. package/src/components/tooltip/types.ts +13 -3
  129. package/src/core/compose/features/textinput.ts +15 -2
  130. package/src/core/compose/features/textlabel.ts +0 -3
  131. package/src/core/composition/features/dom.ts +33 -0
  132. package/src/core/composition/features/icon.ts +131 -0
  133. package/src/core/composition/features/index.ts +11 -0
  134. package/src/core/composition/features/label.ts +156 -0
  135. package/src/core/composition/features/structure.ts +22 -0
  136. package/src/core/composition/index.ts +26 -0
  137. package/src/core/index.ts +1 -1
  138. package/src/core/structure.ts +288 -0
  139. package/src/index.ts +1 -0
  140. package/src/styles/components/_navigation-mobile.scss +244 -0
  141. package/src/styles/components/_navigation-system.scss +151 -0
  142. package/src/{components/tabs/_styles.scss → styles/components/_tabs.scss} +1 -1
  143. package/src/{components/textfield/_styles.scss → styles/components/_textfield.scss} +314 -72
  144. package/src/styles/main.scss +98 -49
  145. package/src/components/badge/constants.ts +0 -40
  146. package/src/components/button/constants.ts +0 -11
  147. package/src/components/card/constants.ts +0 -84
  148. package/src/components/datepicker/constants.ts +0 -98
  149. package/src/components/dialog/constants.ts +0 -32
  150. package/src/components/extended-fab/constants.ts +0 -36
  151. package/src/components/fab/constants.ts +0 -41
  152. package/src/components/menu/constants.ts +0 -154
  153. package/src/components/navigation/constants.ts +0 -200
  154. package/src/components/progress/constants.ts +0 -29
  155. package/src/components/search/constants.ts +0 -21
  156. package/src/components/segmented-button/constants.ts +0 -42
  157. package/src/components/slider/features/slider.ts +0 -318
  158. package/src/components/slider/features/structure.ts +0 -181
  159. package/src/components/slider/features/ui.ts +0 -388
  160. package/src/components/switch/constants.ts +0 -80
  161. package/src/components/tabs/constants.ts +0 -89
  162. package/src/components/textfield/constants.ts +0 -100
  163. package/src/components/timepicker/constants.ts +0 -138
  164. /package/src/{components/badge/_styles.scss → styles/components/_badge.scss} +0 -0
  165. /package/src/{components/bottom-app-bar/_styles.scss → styles/components/_bottom-app-bar.scss} +0 -0
  166. /package/src/{components/button/_styles.scss → styles/components/_button.scss} +0 -0
  167. /package/src/{components/card/_styles.scss → styles/components/_card.scss} +0 -0
  168. /package/src/{components/carousel/_styles.scss → styles/components/_carousel.scss} +0 -0
  169. /package/src/{components/checkbox/_styles.scss → styles/components/_checkbox.scss} +0 -0
  170. /package/src/{components/chip/_styles.scss → styles/components/_chip.scss} +0 -0
  171. /package/src/{components/datepicker/_styles.scss → styles/components/_datepicker.scss} +0 -0
  172. /package/src/{components/dialog/_styles.scss → styles/components/_dialog.scss} +0 -0
  173. /package/src/{components/divider/_styles.scss → styles/components/_divider.scss} +0 -0
  174. /package/src/{components/extended-fab/_styles.scss → styles/components/_extended-fab.scss} +0 -0
  175. /package/src/{components/fab/_styles.scss → styles/components/_fab.scss} +0 -0
  176. /package/src/{components/list/_styles.scss → styles/components/_list.scss} +0 -0
  177. /package/src/{components/menu/_styles.scss → styles/components/_menu.scss} +0 -0
  178. /package/src/{components/navigation/_styles.scss → styles/components/_navigation.scss} +0 -0
  179. /package/src/{components/progress/_styles.scss → styles/components/_progress.scss} +0 -0
  180. /package/src/{components/radios/_styles.scss → styles/components/_radios.scss} +0 -0
  181. /package/src/{components/search/_styles.scss → styles/components/_search.scss} +0 -0
  182. /package/src/{components/segmented-button/_styles.scss → styles/components/_segmented-button.scss} +0 -0
  183. /package/src/{components/sheet/_styles.scss → styles/components/_sheet.scss} +0 -0
  184. /package/src/{components/slider/_styles.scss → styles/components/_slider.scss} +0 -0
  185. /package/src/{components/snackbar/_styles.scss → styles/components/_snackbar.scss} +0 -0
  186. /package/src/{components/switch/_styles.scss → styles/components/_switch.scss} +0 -0
  187. /package/src/{components/timepicker/_styles.scss → styles/components/_timepicker.scss} +0 -0
  188. /package/src/{components/tooltip/_styles.scss → styles/components/_tooltip.scss} +0 -0
  189. /package/src/{components/top-app-bar/_styles.scss → styles/components/_top-app-bar.scss} +0 -0
  190. /package/src/styles/utilities/{_color.scss → _colors.scss} +0 -0
@@ -28,7 +28,8 @@ $component: '#{base.$prefix}-textfield';
28
28
  border-radius: 2px;
29
29
  color: t.color('on-surface-variant');
30
30
  transition: transform v.motion('duration-short4') v.motion('easing-emphasized'),
31
- color v.motion('duration-short2') v.motion('easing-standard');
31
+ color v.motion('duration-short2') v.motion('easing-standard'),
32
+ left v.motion('duration-short4') v.motion('easing-emphasized');
32
33
  }
33
34
 
34
35
  // Input element
@@ -68,6 +69,65 @@ $component: '#{base.$prefix}-textfield';
68
69
  }
69
70
  }
70
71
  }
72
+
73
+ // Leading icon
74
+ &-leading-icon {
75
+ position: absolute;
76
+ left: 12px;
77
+ top: 50%;
78
+ transform: translateY(-50%);
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ width: 24px;
83
+ height: 24px;
84
+ pointer-events: none;
85
+ color: t.color('on-surface-variant');
86
+ z-index: 1;
87
+
88
+ svg {
89
+ width: 20px;
90
+ height: 20px;
91
+ }
92
+ }
93
+
94
+ // Trailing icon
95
+ &-trailing-icon {
96
+ position: absolute;
97
+ right: 12px;
98
+ top: 50%;
99
+ transform: translateY(-50%);
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ width: 24px;
104
+ height: 24px;
105
+ color: t.color('on-surface-variant');
106
+ z-index: 1;
107
+ cursor: pointer;
108
+
109
+ svg {
110
+ width: 20px;
111
+ height: 20px;
112
+ }
113
+ }
114
+
115
+ // Adjustments when icons are present
116
+ &--with-leading-icon {
117
+ .#{$component}-label {
118
+ left: 44px;
119
+ }
120
+
121
+ .#{$component}-input {
122
+ padding-left: 44px;
123
+ }
124
+ }
125
+
126
+ &--with-trailing-icon {
127
+ .#{$component}-input {
128
+ padding-right: 44px;
129
+ }
130
+ }
71
131
 
72
132
  // Error state
73
133
  &--error {
@@ -76,6 +136,11 @@ $component: '#{base.$prefix}-textfield';
76
136
  .#{$component}-label {
77
137
  color: t.color('error');
78
138
  }
139
+
140
+ .#{$component}-leading-icon,
141
+ .#{$component}-trailing-icon {
142
+ color: t.color('error');
143
+ }
79
144
  }
80
145
 
81
146
  // Disabled state
@@ -85,15 +150,20 @@ $component: '#{base.$prefix}-textfield';
85
150
  background-color: t.alpha('on-surface', 0.04);
86
151
  pointer-events: none;
87
152
 
88
- & ~ .#{$component}-label {
153
+ & ~ .#{$component}-label,
154
+ & ~ .#{$component}-leading-icon,
155
+ & ~ .#{$component}-trailing-icon {
89
156
  color: t.color('on-surface');
90
157
  opacity: 0.38;
91
158
  }
92
159
  }
93
160
 
94
- // Helper text
161
+ // Helper text / Supporting text
95
162
  &-helper {
96
163
  @include m.typography('body-small');
164
+ position: absolute;
165
+ bottom: -18px;
166
+ left: 16px;
97
167
  margin-top: 4px;
98
168
  color: t.color('on-surface-variant');
99
169
 
@@ -127,21 +197,46 @@ $component: '#{base.$prefix}-textfield';
127
197
  margin-left: 0;
128
198
  margin-right: 4px;
129
199
  }
200
+
201
+ &-leading-icon {
202
+ left: auto;
203
+ right: 12px;
204
+ }
205
+
206
+ &-trailing-icon {
207
+ right: auto;
208
+ left: 12px;
209
+ }
210
+
211
+ &--with-leading-icon {
212
+ .#{$component}-label {
213
+ left: auto;
214
+ right: 44px;
215
+ }
216
+
217
+ .#{$component}-input {
218
+ padding-left: 16px;
219
+ padding-right: 44px;
220
+ }
221
+ }
222
+
223
+ &--with-trailing-icon {
224
+ .#{$component}-input {
225
+ padding-right: 16px;
226
+ padding-left: 44px;
227
+ }
228
+ }
130
229
  }
131
230
 
132
231
  // ===== FILLED VARIANT =====
133
232
  &--filled {
134
- border-bottom: 1px solid t.color('outline');
135
-
136
233
  .#{$component}-input {
137
234
  background-color: t.color('surface-container-highest');
138
235
  padding: 20px 16px 7px;
236
+ border-bottom: 1px solid t.color('outline');
139
237
  border-radius: f.get-shape('extra-small') f.get-shape('extra-small') 0 0;
140
238
  @include m.motion-transition(background-color, border-color);
141
-
142
- &:focus {
143
- padding-bottom: 6px;
144
- }
239
+
145
240
 
146
241
  // Autofill styles for filled variant
147
242
  &:-webkit-autofill {
@@ -161,6 +256,19 @@ $component: '#{base.$prefix}-textfield';
161
256
  }
162
257
  }
163
258
 
259
+ &::before {
260
+ content: '';
261
+ position: absolute;
262
+ opacity: 0;
263
+ bottom: 0;
264
+ width: 100%;
265
+ height: 2px;
266
+ background-color: t.color('primary');
267
+ border-radius: 0;
268
+ pointer-events: none;
269
+ transition: 0.2s opacity ease;
270
+ }
271
+
164
272
  // Populated field (not empty) or focused field label position
165
273
  &:not(.#{$component}--empty) .#{$component}-label,
166
274
  &.#{$component}--focused .#{$component}-label {
@@ -168,48 +276,33 @@ $component: '#{base.$prefix}-textfield';
168
276
  }
169
277
 
170
278
  // Focus state
171
- &.#{$component}--focused {
172
- border-bottom: 2px solid t.color('primary');
173
-
279
+ &.#{$component}--focused {
174
280
  .#{$component}-label {
175
281
  color: t.color('primary');
176
282
  }
177
283
 
178
- .#{$component}-input {
179
- height: 55px;
180
- padding: 20px 16px 6px;
181
- }
182
-
183
-
184
- &:hover {
185
- border-bottom: 2px solid t.color('primary');
284
+ &::before {
285
+ opacity: 1
186
286
  }
187
287
  }
188
288
 
189
289
  // Hover state
190
- &:hover {
191
- border-bottom: 1px solid t.color('primary');
192
-
290
+ &:hover {
193
291
  .#{$component}-label {
194
292
  color: t.color('primary');
195
293
  }
196
294
  }
197
295
 
198
296
  // Error state
199
- &.#{$component}--error {
200
- border-bottom: 2px solid t.color('error');
201
-
297
+ &.#{$component}--error {
298
+ &::before {
299
+ opacity: 1;
300
+ background-color: t.color('error');
301
+ }
302
+
202
303
  .#{$component}-label {
203
304
  color: t.color('error');
204
305
  }
205
-
206
- &:hover {
207
- border-bottom: 2px solid t.color('error');
208
- }
209
-
210
- &.#{$component}--focused {
211
- border-bottom: 2px solid t.color('error');
212
- }
213
306
  }
214
307
 
215
308
  // Disabled state
@@ -222,24 +315,80 @@ $component: '#{base.$prefix}-textfield';
222
315
  }
223
316
  }
224
317
 
318
+ // Icon adjustments for filled variant
319
+ &.#{$component}--with-leading-icon {
320
+ .#{$component}-input {
321
+ padding: 20px 16px 7px 44px;
322
+ }
323
+
324
+ .#{$component}-label {
325
+ left: 44px;
326
+ }
327
+
328
+ &:not(.#{$component}--empty) .#{$component}-label,
329
+ &.#{$component}--focused .#{$component}-label {
330
+ transform: translateY(-95%) scale(0.75);
331
+ // Keep the label aligned with input text when focused/filled
332
+ left: 44px;
333
+ }
334
+
335
+ .#{$component}-leading-icon {
336
+ top: 28px;
337
+ }
338
+ }
339
+
340
+ &.#{$component}--with-trailing-icon {
341
+ .#{$component}-input {
342
+ padding-right: 44px;
343
+ }
344
+
345
+ .#{$component}-trailing-icon {
346
+ top: 28px;
347
+ }
348
+ }
349
+
225
350
  // RTL support
226
351
  @include m.rtl {
227
352
  .#{$component}-label {
228
353
  left: auto;
229
354
  right: 16px;
230
355
  }
356
+
357
+ &.#{$component}--with-leading-icon {
358
+ .#{$component}-input {
359
+ padding: 20px 44px 7px 16px;
360
+ }
361
+
362
+ .#{$component}-label {
363
+ left: auto;
364
+ right: 44px;
365
+ }
366
+
367
+ &:not(.#{$component}--empty) .#{$component}-label,
368
+ &.#{$component}--focused .#{$component}-label {
369
+ // Keep the label aligned with input text when focused/filled in RTL
370
+ right: 44px;
371
+ }
372
+ }
373
+
374
+ &.#{$component}--with-trailing-icon {
375
+ .#{$component}-input {
376
+ padding-right: 16px;
377
+ padding-left: 44px;
378
+ }
379
+ }
231
380
  }
232
381
  }
233
382
 
234
383
  // ===== OUTLINED VARIANT =====
235
384
  &--outlined {
236
- border: 1px solid t.color('outline');
237
385
  border-radius: f.get-shape('extra-small');
238
386
  @include m.motion-transition(border-color);
239
387
 
240
388
  .#{$component}-input {
241
389
  background-color: transparent;
242
- padding: 13px 16px 14px;
390
+ padding: 12px 15px 13px;
391
+ border: 1px solid t.color('outline');
243
392
  @include m.motion-transition(padding);
244
393
 
245
394
  // Autofill styles for outlined variant
@@ -249,8 +398,6 @@ $component: '#{base.$prefix}-textfield';
249
398
  & ~ .#{$component}-label {
250
399
  background-color: t.color('surface');
251
400
  transform: translateY(-145%) scale(0.75);
252
- left: 13px;
253
- padding: 0 4px;
254
401
  }
255
402
  }
256
403
 
@@ -258,73 +405,102 @@ $component: '#{base.$prefix}-textfield';
258
405
  & ~ .#{$component}-label {
259
406
  background-color: t.color('surface');
260
407
  transform: translateY(-145%) scale(0.75);
261
- left: 13px;
262
- padding: 0 4px;
263
408
  }
264
409
  }
265
410
  }
266
411
 
412
+ .#{$component}-label {
413
+ padding: 0 4px;
414
+ left: 12px;
415
+ top: 49%;
416
+ }
417
+
418
+ &::before {
419
+ content: '';
420
+ position: absolute;
421
+ opacity: 0;
422
+ width: 100%;
423
+ height: 100%;
424
+ border: 1.5px solid t.color('primary');
425
+ border-radius: f.get-shape('extra-small');
426
+ pointer-events: none;
427
+ transition: 0.1s opacity ease;
428
+ }
429
+
267
430
  // Populated field (not empty) or focused field label position
268
431
  &:not(.#{$component}--empty) .#{$component}-label,
269
432
  &.#{$component}--focused .#{$component}-label {
270
- background-color: t.color('surface');
271
- transform: translateY(-145%) scale(0.75);
272
- left: 13px;
273
433
  padding: 0 4px;
434
+ background-color: t.color('surface');
435
+ transform: translateY(-147%) scale(0.75);
274
436
  }
275
437
 
276
438
  // Focus state
277
439
  &.#{$component}--focused {
278
- border: 2px solid t.color('primary');
279
-
280
- .#{$component}-label {
281
- color: t.color('primary');
282
- border-radius: 2px;
283
- left: 12px;
284
- }
285
-
286
- .#{$component}-input {
287
- height: 54px;
288
- padding: 12px 15px 13px;
440
+ &::before {
441
+ opacity: 1;
289
442
  }
290
-
291
443
  &:hover {
292
- border: 2px solid t.color('primary');
444
+ &::before {
445
+ border-width: 2px;
446
+ }
293
447
  }
294
448
  }
295
449
 
296
450
  // Hover state
297
- &:hover {
298
- border: 1px solid t.color('primary');
299
-
451
+ &:hover {
300
452
  .#{$component}-label {
301
453
  color: t.color('primary');
302
454
  }
455
+
456
+ &::before {
457
+ opacity: 1;
458
+ border: 1px solid t.color('primary');
459
+ }
303
460
  }
304
461
 
305
462
  // Error state
306
- &.#{$component}--error {
307
- border: 2px solid t.color('error');
308
-
463
+ &.#{$component}--error {
464
+ &::before {
465
+ opacity: 1;
466
+ border: 2px solid t.color('error');
467
+ }
468
+
309
469
  .#{$component}-label {
310
470
  color: t.color('error');
311
- left: 12px;
312
471
  }
313
-
472
+ }
473
+
474
+ // Disabled state
475
+ &.#{$component}--disabled {
476
+ pointer-events: none;
477
+ &::before {
478
+ opacity: 1;
479
+ border: 1px solid t.alpha('on-surface', 0.38);
480
+ }
481
+ }
482
+
483
+ // Icon adjustments for outlined variant
484
+ &.#{$component}--with-leading-icon {
314
485
  .#{$component}-input {
315
- padding: 12px 15px 13px;
486
+ padding-left: 44px;
316
487
  }
317
488
 
318
- &:hover,
319
- &.#{$component}--focused {
320
- border: 2px solid t.color('error');
489
+ .#{$component}-label {
490
+ left: 44px;
491
+ }
492
+
493
+ &:not(.#{$component}--empty) .#{$component}-label,
494
+ &.#{$component}--focused .#{$component}-label {
495
+ // For outlined variant, move label to default position
496
+ left: 13px;
321
497
  }
322
498
  }
323
499
 
324
- // Disabled state
325
- &.#{$component}--disabled {
326
- border-color: t.alpha('on-surface', 0.38);
327
- pointer-events: none;
500
+ &.#{$component}--with-trailing-icon {
501
+ .#{$component}-input {
502
+ padding-right: 44px;
503
+ }
328
504
  }
329
505
 
330
506
  // RTL support
@@ -342,6 +518,72 @@ $component: '#{base.$prefix}-textfield';
342
518
  &.#{$component}--error .#{$component}-label {
343
519
  right: 12px;
344
520
  }
521
+
522
+ &.#{$component}--with-leading-icon {
523
+ .#{$component}-input {
524
+ padding-left: 16px;
525
+ padding-right: 44px;
526
+ }
527
+
528
+ .#{$component}-label {
529
+ left: auto;
530
+ right: 44px;
531
+ }
532
+
533
+ &:not(.#{$component}--empty) .#{$component}-label,
534
+ &.#{$component}--focused .#{$component}-label {
535
+ // For outlined variant in RTL, move label to default position
536
+ right: 13px;
537
+ left: auto;
538
+ }
539
+ }
540
+
541
+ &.#{$component}--with-trailing-icon {
542
+ .#{$component}-input {
543
+ padding-right: 16px;
544
+ padding-left: 44px;
545
+ }
546
+ }
547
+ }
548
+ }
549
+
550
+ // Multiline styles
551
+ &--multiline {
552
+ .#{$component}-input {
553
+ min-height: 100px;
554
+ height: auto;
555
+ resize: vertical;
556
+ padding-top: 12px;
557
+ }
558
+
559
+ &--filled {
560
+ .#{$component}-input {
561
+
562
+ }
563
+ }
564
+
565
+ &--outlined {
566
+ .#{$component}-input {
567
+
568
+ }
569
+ }
570
+
571
+
572
+ .#{$component}-label {
573
+ top: 24px;
574
+ }
575
+ }
576
+
577
+
578
+ // Support for multiline inputs
579
+ &-input[type="multiline"] {
580
+ min-height: 100px;
581
+ resize: vertical;
582
+
583
+ & ~ .#{$component}-leading-icon,
584
+ & ~ .#{$component}-trailing-icon {
585
+ top: 20px;
586
+ transform: none;
345
587
  }
346
588
  }
347
589
  }