material 3.7.2 → 3.7.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 (264) hide show
  1. package/README.md +2 -2
  2. package/dist/components/slider/features/controller.js +24 -8
  3. package/dist/elements/css/card.css +1 -1
  4. package/dist/elements/css/card.js +1 -1
  5. package/dist/elements/css/dialog.css +1 -1
  6. package/dist/elements/css/dialog.js +1 -1
  7. package/dist/elements/css/menu.css +1 -1
  8. package/dist/elements/css/menu.js +1 -1
  9. package/dist/elements/css/select.css +1 -1
  10. package/dist/elements/css/select.js +1 -1
  11. package/dist/elements/css/slider.css +1 -1
  12. package/dist/elements/css/slider.js +1 -1
  13. package/dist/elements/css/tabs.css +1 -1
  14. package/dist/elements/css/tabs.js +1 -1
  15. package/dist/elements/css/timepicker.css +1 -1
  16. package/dist/elements/css/timepicker.js +1 -1
  17. package/dist/elements/preupgrade/badge.css +1 -1
  18. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  19. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  20. package/dist/elements/preupgrade/button-group.css +1 -1
  21. package/dist/elements/preupgrade/button.css +1 -1
  22. package/dist/elements/preupgrade/card.css +1 -1
  23. package/dist/elements/preupgrade/carousel.css +1 -1
  24. package/dist/elements/preupgrade/checkbox.css +1 -1
  25. package/dist/elements/preupgrade/chips.css +1 -1
  26. package/dist/elements/preupgrade/datepicker.css +1 -1
  27. package/dist/elements/preupgrade/dialog.css +1 -1
  28. package/dist/elements/preupgrade/divider.css +1 -1
  29. package/dist/elements/preupgrade/drawer.css +1 -1
  30. package/dist/elements/preupgrade/extended-fab.css +1 -1
  31. package/dist/elements/preupgrade/fab-menu.css +1 -1
  32. package/dist/elements/preupgrade/fab.css +1 -1
  33. package/dist/elements/preupgrade/icon-button.css +1 -1
  34. package/dist/elements/preupgrade/list.css +1 -1
  35. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  36. package/dist/elements/preupgrade/menu.css +1 -1
  37. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  38. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  39. package/dist/elements/preupgrade/progress.css +1 -1
  40. package/dist/elements/preupgrade/radios.css +1 -1
  41. package/dist/elements/preupgrade/search.css +1 -1
  42. package/dist/elements/preupgrade/select.css +1 -1
  43. package/dist/elements/preupgrade/side-sheet.css +1 -1
  44. package/dist/elements/preupgrade/slider.css +1 -1
  45. package/dist/elements/preupgrade/snackbar.css +1 -1
  46. package/dist/elements/preupgrade/split-button.css +1 -1
  47. package/dist/elements/preupgrade/switch.css +1 -1
  48. package/dist/elements/preupgrade/tabs.css +1 -1
  49. package/dist/elements/preupgrade/text-field.css +1 -1
  50. package/dist/elements/preupgrade/timepicker.css +1 -1
  51. package/dist/elements/preupgrade/toolbar.css +1 -1
  52. package/dist/elements/preupgrade/tooltip.css +1 -1
  53. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  54. package/dist/elements/preupgrade.css +1 -1
  55. package/dist/styles/badge.css +1 -1
  56. package/dist/styles/base-lite.css +1 -1
  57. package/dist/styles/base.css +1 -1
  58. package/dist/styles/bottom-app-bar.css +1 -1
  59. package/dist/styles/bottom-sheet.css +1 -1
  60. package/dist/styles/button-group.css +1 -1
  61. package/dist/styles/button.css +1 -1
  62. package/dist/styles/card.css +2 -2
  63. package/dist/styles/carousel.css +1 -1
  64. package/dist/styles/checkbox.css +1 -1
  65. package/dist/styles/chips.css +1 -1
  66. package/dist/styles/contrast.css +1 -1
  67. package/dist/styles/datepicker.css +1 -1
  68. package/dist/styles/dialog.css +2 -2
  69. package/dist/styles/divider.css +1 -1
  70. package/dist/styles/drawer.css +1 -1
  71. package/dist/styles/extended-fab.css +1 -1
  72. package/dist/styles/fab-menu.css +1 -1
  73. package/dist/styles/fab.css +1 -1
  74. package/dist/styles/icon-button.css +1 -1
  75. package/dist/styles/list.css +1 -1
  76. package/dist/styles/loading-indicator.css +1 -1
  77. package/dist/styles/menu.css +2 -2
  78. package/dist/styles/navigation-bar.css +1 -1
  79. package/dist/styles/navigation-rail.css +1 -1
  80. package/dist/styles/progress.css +1 -1
  81. package/dist/styles/radios.css +1 -1
  82. package/dist/styles/search.css +1 -1
  83. package/dist/styles/select.css +2 -2
  84. package/dist/styles/side-sheet.css +1 -1
  85. package/dist/styles/slider.css +2 -2
  86. package/dist/styles/snackbar.css +1 -1
  87. package/dist/styles/split-button.css +1 -1
  88. package/dist/styles/switch.css +1 -1
  89. package/dist/styles/tabs.css +2 -2
  90. package/dist/styles/text-field.css +1 -1
  91. package/dist/styles/timepicker.css +2 -2
  92. package/dist/styles/toolbar.css +1 -1
  93. package/dist/styles/tooltip.css +1 -1
  94. package/dist/styles/top-app-bar.css +1 -1
  95. package/dist/styles/typography.css +1 -1
  96. package/dist/styles/utilities.css +1 -1
  97. package/dist/styles.css +2 -2
  98. package/dist/themes/autumn-contrast.css +1 -1
  99. package/dist/themes/autumn.css +1 -1
  100. package/dist/themes/baseline-contrast.css +1 -1
  101. package/dist/themes/baseline.css +1 -1
  102. package/dist/themes/brownbeige-contrast.css +1 -1
  103. package/dist/themes/brownbeige.css +1 -1
  104. package/dist/themes/content-contrast.css +1 -1
  105. package/dist/themes/content.css +1 -1
  106. package/dist/themes/desert-contrast.css +1 -1
  107. package/dist/themes/desert.css +1 -1
  108. package/dist/themes/expressive-contrast.css +1 -1
  109. package/dist/themes/expressive.css +1 -1
  110. package/dist/themes/fidelity-contrast.css +1 -1
  111. package/dist/themes/fidelity.css +1 -1
  112. package/dist/themes/forest-contrast.css +1 -1
  113. package/dist/themes/forest.css +1 -1
  114. package/dist/themes/fruit-salad-contrast.css +1 -1
  115. package/dist/themes/fruit-salad.css +1 -1
  116. package/dist/themes/highcontrast-contrast.css +1 -1
  117. package/dist/themes/highcontrast.css +1 -1
  118. package/dist/themes/monochrome-contrast.css +1 -1
  119. package/dist/themes/monochrome.css +1 -1
  120. package/dist/themes/neutral-contrast.css +1 -1
  121. package/dist/themes/neutral.css +1 -1
  122. package/dist/themes/ocean-contrast.css +1 -1
  123. package/dist/themes/ocean.css +1 -1
  124. package/dist/themes/rainbow-contrast.css +1 -1
  125. package/dist/themes/rainbow.css +1 -1
  126. package/dist/themes/sageivory-contrast.css +1 -1
  127. package/dist/themes/sageivory.css +1 -1
  128. package/dist/themes/spring-contrast.css +1 -1
  129. package/dist/themes/spring.css +1 -1
  130. package/dist/themes/summer-contrast.css +1 -1
  131. package/dist/themes/summer.css +1 -1
  132. package/dist/themes/sunset-contrast.css +1 -1
  133. package/dist/themes/sunset.css +1 -1
  134. package/dist/themes/tealcaramel-contrast.css +1 -1
  135. package/dist/themes/tealcaramel.css +1 -1
  136. package/dist/themes/vibrant-contrast.css +1 -1
  137. package/dist/themes/vibrant.css +1 -1
  138. package/package.json +2 -1
  139. package/src/styles/abstract/_base.scss +0 -1
  140. package/src/styles/abstract/_direction.scss +121 -152
  141. package/src/styles/abstract/_emit.scss +7 -16
  142. package/src/styles/abstract/_floating-placement.scss +9 -10
  143. package/src/styles/abstract/_functions.scss +64 -79
  144. package/src/styles/abstract/_mixins.scss +355 -459
  145. package/src/styles/abstract/_theme.scss +122 -136
  146. package/src/styles/abstract/_variables.scss +320 -390
  147. package/src/styles/abstract/chips/_assist.scss +2 -3
  148. package/src/styles/abstract/chips/_filter.scss +2 -3
  149. package/src/styles/abstract/chips/_input.scss +2 -3
  150. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  151. package/src/styles/base/_body-theme.scss +10 -15
  152. package/src/styles/base/_document.scss +10 -33
  153. package/src/styles/base/_reset.scss +20 -40
  154. package/src/styles/base/_tokens.scss +6 -21
  155. package/src/styles/base/_typescale-tokens.scss +12 -16
  156. package/src/styles/base/_typography.scss +28 -37
  157. package/src/styles/components/_badge.scss +171 -193
  158. package/src/styles/components/_bottom-app-bar.scss +72 -90
  159. package/src/styles/components/_bottom-sheet.scss +188 -232
  160. package/src/styles/components/_button-group.scss +140 -189
  161. package/src/styles/components/_button.scss +382 -478
  162. package/src/styles/components/_card.scss +349 -473
  163. package/src/styles/components/_carousel.scss +134 -156
  164. package/src/styles/components/_checkbox.scss +208 -249
  165. package/src/styles/components/_chips.scss +239 -304
  166. package/src/styles/components/_datepicker.scss +172 -222
  167. package/src/styles/components/_dialog.scss +428 -553
  168. package/src/styles/components/_divider.scss +37 -46
  169. package/src/styles/components/_drawer.scss +571 -678
  170. package/src/styles/components/_extended-fab.scss +263 -294
  171. package/src/styles/components/_fab-menu.scss +225 -267
  172. package/src/styles/components/_fab.scss +197 -218
  173. package/src/styles/components/_icon-button.scss +483 -588
  174. package/src/styles/components/_list.scss +115 -144
  175. package/src/styles/components/_loading-indicator.scss +23 -29
  176. package/src/styles/components/_menu.scss +543 -699
  177. package/src/styles/components/_navigation-bar.scss +189 -234
  178. package/src/styles/components/_navigation-rail.scss +256 -312
  179. package/src/styles/components/_progress.scss +60 -85
  180. package/src/styles/components/_radios.scss +170 -207
  181. package/src/styles/components/_search.scss +369 -455
  182. package/src/styles/components/_select.scss +78 -185
  183. package/src/styles/components/_side-sheet.scss +234 -292
  184. package/src/styles/components/_slider.scss +289 -367
  185. package/src/styles/components/_snackbar.scss +149 -198
  186. package/src/styles/components/_split-button.scss +139 -228
  187. package/src/styles/components/_switch.scss +282 -349
  188. package/src/styles/components/_tabs.scss +350 -547
  189. package/src/styles/components/_text-field.scss +788 -980
  190. package/src/styles/components/_timepicker.scss +435 -506
  191. package/src/styles/components/_toolbar.scss +178 -242
  192. package/src/styles/components/_tooltip.scss +152 -197
  193. package/src/styles/components/_top-app-bar.scss +206 -230
  194. package/src/styles/elements/_badge.scss +42 -61
  195. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  196. package/src/styles/elements/_bottom-sheet.scss +0 -3
  197. package/src/styles/elements/_button-group.scss +80 -80
  198. package/src/styles/elements/_button.scss +72 -88
  199. package/src/styles/elements/_card.scss +48 -57
  200. package/src/styles/elements/_carousel.scss +2 -5
  201. package/src/styles/elements/_checkbox.scss +32 -43
  202. package/src/styles/elements/_chips.scss +18 -22
  203. package/src/styles/elements/_config.scss +11 -26
  204. package/src/styles/elements/_datepicker.scss +17 -22
  205. package/src/styles/elements/_dialog.scss +0 -3
  206. package/src/styles/elements/_divider.scss +11 -13
  207. package/src/styles/elements/_drawer.scss +9 -14
  208. package/src/styles/elements/_extended-fab.scss +36 -40
  209. package/src/styles/elements/_fab-menu.scss +21 -25
  210. package/src/styles/elements/_fab.scss +17 -20
  211. package/src/styles/elements/_field.scss +93 -114
  212. package/src/styles/elements/_icon-button.scss +34 -38
  213. package/src/styles/elements/_index.scss +0 -4
  214. package/src/styles/elements/_list.scss +19 -26
  215. package/src/styles/elements/_loading-indicator.scss +6 -9
  216. package/src/styles/elements/_menu.scss +0 -3
  217. package/src/styles/elements/_navigation-bar.scss +5 -9
  218. package/src/styles/elements/_navigation-rail.scss +10 -15
  219. package/src/styles/elements/_progress.scss +15 -18
  220. package/src/styles/elements/_radios.scss +24 -49
  221. package/src/styles/elements/_search.scss +19 -24
  222. package/src/styles/elements/_select.scss +4 -9
  223. package/src/styles/elements/_side-sheet.scss +0 -3
  224. package/src/styles/elements/_slider.scss +15 -35
  225. package/src/styles/elements/_snackbar.scss +0 -3
  226. package/src/styles/elements/_split-button.scss +33 -39
  227. package/src/styles/elements/_switch.scss +50 -90
  228. package/src/styles/elements/_tabs.scss +9 -13
  229. package/src/styles/elements/_text-field.scss +150 -178
  230. package/src/styles/elements/_timepicker.scss +0 -3
  231. package/src/styles/elements/_toolbar.scss +30 -35
  232. package/src/styles/elements/_tooltip.scss +0 -3
  233. package/src/styles/elements/_top-app-bar.scss +38 -45
  234. package/src/styles/main.scss +0 -15
  235. package/src/styles/themes/_autumn.scss +240 -258
  236. package/src/styles/themes/_base-theme.scss +96 -128
  237. package/src/styles/themes/_baseline.scss +273 -314
  238. package/src/styles/themes/_brownbeige.scss +242 -250
  239. package/src/styles/themes/_content.scss +240 -248
  240. package/src/styles/themes/_desert.scss +242 -250
  241. package/src/styles/themes/_expressive.scss +242 -250
  242. package/src/styles/themes/_fidelity.scss +240 -248
  243. package/src/styles/themes/_forest.scss +242 -259
  244. package/src/styles/themes/_fruit-salad.scss +242 -250
  245. package/src/styles/themes/_highcontrast.scss +164 -172
  246. package/src/styles/themes/_index.scss +0 -1
  247. package/src/styles/themes/_monochrome.scss +226 -234
  248. package/src/styles/themes/_neutral.scss +242 -250
  249. package/src/styles/themes/_ocean.scss +242 -259
  250. package/src/styles/themes/_rainbow.scss +242 -250
  251. package/src/styles/themes/_sageivory.scss +242 -250
  252. package/src/styles/themes/_spring.scss +238 -255
  253. package/src/styles/themes/_summer.scss +242 -250
  254. package/src/styles/themes/_sunset.scss +242 -259
  255. package/src/styles/themes/_tealcaramel.scss +242 -250
  256. package/src/styles/themes/_vibrant.scss +242 -250
  257. package/src/styles/utilities/_colors.scss +44 -50
  258. package/src/styles/utilities/_flexbox.scss +48 -59
  259. package/src/styles/utilities/_layout.scss +516 -591
  260. package/src/styles/utilities/_ripple.scss +61 -70
  261. package/src/styles/utilities/_spacing.scss +120 -127
  262. package/src/styles/utilities/_typography.scss +45 -58
  263. package/src/styles/utilities/_visibility.scss +61 -76
  264. package/dist/package.json +0 -488
@@ -1,4 +1,3 @@
1
- // src/components/card/_styles.scss
2
1
  @use '../../styles/abstract/base' as base;
3
2
  @use '../../styles/abstract/variables' as v;
4
3
  @use '../../styles/abstract/functions' as f;
@@ -8,477 +7,354 @@
8
7
  $component: '#{base.$prefix}-card';
9
8
 
10
9
  .#{$component} {
11
- // Base styles
12
- position: relative;
13
- display: flex;
14
- flex-direction: column;
15
- box-sizing: border-box;
16
- border-radius: f.get-shape('medium'); // Use function for MD3 standard shape
17
- background-color: t.color('surface');
18
- color: t.color('on-surface');
19
- overflow: hidden;
20
- // No width of its own. A card fills the column, grid cell or flex track it
21
- // is placed in, as the M3 card specs describe. This used to be a hard 344px,
22
- // which meant every card had to opt out of its own component to sit in a
23
- // layout. The sizes are still available as modifiers below for the cases
24
- // that genuinely want them.
25
- // Typography - use mixin
26
- @include m.typography('body-medium');
27
-
28
- // Transition for elevation and hover states - use motion-transition mixin
29
- @include m.motion-transition(
30
- box-shadow,
31
- background-color,
32
- border-color
33
- );
34
-
35
- // Focus outline for accessibility - use focus-ring mixin
36
- &:focus-visible {
37
- @include m.focus-ring(t.color('secondary'));
38
- }
39
-
40
- // Focus state class
41
- &--focused {
42
- @include m.focus-ring(t.color('secondary'));
43
- }
44
-
45
- // Ripple styles for clickable cards
46
- .ripple {
47
- position: absolute;
48
- border-radius: 50%;
49
- transform: scale(0);
50
- pointer-events: none;
51
- background-color: currentColor;
52
- opacity: f.get-state-opacity('hover'); // Use function for standard opacity
53
- }
54
-
55
- // Ensure proper stacking for inner components
56
- > :not(:last-child) {
57
- margin-bottom: 0;
58
- }
59
-
60
- // === Variants - use proper theme colors ===
61
-
62
- // Elevated: ElevatedCardTokens. Level 1 at rest, 2 hovered, back to 1 when
63
- // pressed or focused, 4 while dragged.
64
- &--elevated {
65
- background-color: t.color('surface-container-low');
66
- @include m.elevation(1);
67
-
68
- &:hover.#{$component}--interactive {
69
- @include m.elevation(2);
70
- }
71
-
72
- &:active.#{$component}--interactive {
73
- @include m.elevation(1);
74
- @include m.state-layer(t.color('on-surface'), 'pressed');
75
- }
76
-
77
- &.#{$component}--dragging {
78
- @include m.elevation(4); // DraggedContainerElevation
79
- }
80
-
81
- &.#{$component}--state-disabled {
82
- background-color: t.color('surface'); // DisabledContainerColor
83
- @include m.elevation(1); // it keeps its elevation while disabled
84
- }
85
- }
86
-
87
- // Filled: FilledCardTokens. Flat at rest, and it rises to level 1 on hover,
88
- // which is the only elevation it ever takes.
89
- &--filled {
90
- background-color: t.color('surface-container-highest');
91
- @include m.elevation(0);
92
-
93
- &:hover.#{$component}--interactive {
94
- @include m.elevation(1); // HoverContainerElevation
95
- @include m.state-layer(t.color('on-surface'), 'hover');
96
- }
97
-
98
- &:active.#{$component}--interactive {
99
- @include m.elevation(0);
100
- @include m.state-layer(t.color('on-surface'), 'pressed');
101
- }
102
-
103
- &.#{$component}--dragging {
104
- @include m.elevation(3); // DraggedContainerElevation
105
- }
106
-
107
- &.#{$component}--state-disabled {
108
- background-color: t.color('surface-variant'); // DisabledContainerColor
109
- }
110
- }
111
-
112
- // Outlined: OutlinedCardTokens. The outline is outline-variant at rest and
113
- // hovered, and on-surface once focused, which is the only state that changes
114
- // it. It used to sit at the darker `outline` and lighten on hover, which is
115
- // the wrong role and the wrong direction.
116
- &--outlined {
117
- border: 1px solid t.color('outline-variant'); // OutlineColor
118
- background-color: t.color('surface');
119
- @include m.elevation(0);
120
-
121
- &:hover.#{$component}--interactive {
122
- @include m.elevation(1); // HoverContainerElevation
123
- @include m.state-layer(t.color('on-surface'), 'hover');
124
- border-color: t.color('outline-variant'); // HoverOutlineColor
125
- }
126
-
127
- &:focus-visible,
128
- &.#{$component}--focused {
129
- border-color: t.color('on-surface'); // FocusOutlineColor
130
- }
131
-
132
- &:active.#{$component}--interactive {
133
- @include m.elevation(0);
134
- @include m.state-layer(t.color('on-surface'), 'pressed');
135
- border-color: t.color('outline-variant'); // PressedOutlineColor
136
- }
137
-
138
- &.#{$component}--dragging {
139
- @include m.elevation(3); // DraggedContainerElevation
140
- }
141
-
142
- &.#{$component}--state-disabled {
143
- // DisabledOutlineColor at DisabledOutlineOpacity
144
- border-color: t.alpha('outline', 0.12);
145
- }
146
- }
147
-
148
- // === Modifiers ===
149
-
150
- // Interactive cards
151
- &--interactive {
152
- cursor: pointer;
153
- user-select: none;
154
- }
155
-
156
- // Widths, for the cases that want a fixed one. A card has none by default.
157
- &--full-width {
158
- width: 100%;
159
- }
160
-
161
- &--small {
162
- width: v.card('width-small');
163
- }
164
-
165
- &--medium {
166
- width: v.card('width-medium');
167
- }
168
-
169
- &--large {
170
- width: v.card('width-large');
171
- }
172
-
173
- // === Sub-components ===
174
-
175
- // Card Header
176
- &__header {
177
- display: flex;
178
- align-items: center;
179
- padding: v.card('padding');
180
- padding-bottom: 0;
181
-
182
- // A header that is the card's edge keeps the same 16px the other sides use.
183
- // Interior headers stay flush so content or actions can follow.
184
- &:last-child {
185
- padding-bottom: v.card('padding');
186
- }
187
-
188
- &-avatar {
189
- margin-right: v.card('padding');
190
- @include m.rtl {
191
- margin-right: 0;
192
- margin-left: v.card('padding');
193
- }
194
- flex-shrink: 0;
195
- display: flex;
196
- align-items: center;
197
- justify-content: center;
198
-
199
- img {
200
- width: 40px;
201
- height: 40px;
202
- border-radius: 50%;
203
- object-fit: cover;
204
- }
205
- }
206
-
207
- &-text {
208
- flex: 1;
209
- overflow: hidden;
210
- }
211
-
212
- &-title {
213
- margin: 0;
214
- @include m.typography('title-large');
215
- @include m.truncate;
216
- color: t.color('on-surface');
217
- }
218
-
219
- &-subtitle {
220
- margin: 0;
221
- @include m.typography('body-medium');
222
- @include m.truncate;
223
- color: t.color('on-surface-variant');
224
- }
225
-
226
- &-action {
227
- margin-left: 8px;
228
- @include m.rtl {
229
- margin-left: 0;
230
- margin-right: 8px;
231
- }
232
- flex-shrink: 0;
233
- }
234
- }
235
-
236
- // Card Media
237
- &__media {
238
- position: relative;
239
- overflow: hidden;
240
- border-radius: f.get-shape('medium');
241
- &-img {
242
- display: block;
243
- width: 100%;
244
- object-fit: cover;
245
- }
246
-
247
- // Aspect ratios
248
- &--16-9 {
249
- aspect-ratio: 16 / 9;
250
-
251
- img {
252
- height: 100%;
253
- }
254
- }
255
-
256
- &--4-3 {
257
- aspect-ratio: 4 / 3;
258
-
259
- img {
260
- height: 100%;
261
- }
262
- }
263
-
264
- &--1-1 {
265
- aspect-ratio: 1 / 1;
266
-
267
- img {
268
- height: 100%;
269
- }
270
- }
271
-
272
- &--contain {
273
- img {
274
- object-fit: contain;
275
- }
276
- }
277
- }
278
-
279
- // Card Content
280
- &__content {
281
- padding: v.card('padding');
282
- flex: 1 1 auto;
283
-
284
- > *:first-child {
285
- margin-top: 0;
286
- }
287
-
288
- > *:last-child {
289
- margin-bottom: 0;
290
- }
291
-
292
- // When content follows media without padding
293
- .#{$component}__media + &:not(.#{$component}__content--no-padding) {
294
- padding-top: v.card('padding');
295
- }
296
-
297
- // No padding modifier
298
- &--no-padding {
299
- padding: 0;
300
- }
301
- }
302
-
303
- // Card Actions
304
- &__actions {
305
- display: flex;
306
- flex-wrap: wrap;
307
- padding: 8px;
308
- align-items: center;
309
-
310
- > * {
311
- margin: 0 4px;
312
-
313
- &:first-child {
314
- margin-left: 8px;
315
- }
316
-
317
- &:last-child {
318
- margin-right: 8px;
319
- }
320
-
321
- @include m.rtl {
322
- &:first-child {
323
- margin-left: 4px;
324
- margin-right: 8px;
325
- }
326
-
327
- &:last-child {
328
- margin-right: 4px;
329
- margin-left: 8px;
330
- }
331
- }
332
- }
333
-
334
- // Full-bleed actions
335
- &--full-bleed {
336
- padding: 0;
337
-
338
- > * {
339
- margin: 0;
340
- border-radius: 0;
341
- flex: 1 1 auto;
342
-
343
- &:first-child {
344
- margin-left: 0;
345
- }
346
-
347
- &:last-child {
348
- margin-right: 0;
349
- }
350
- }
351
- }
352
-
353
- // Vertical actions
354
- &--vertical {
355
- flex-direction: column;
356
-
357
- > * {
358
- width: 100%;
359
- margin: 4px 0;
360
-
361
- &:first-child {
362
- margin-top: 8px;
363
- }
364
-
365
- &:last-child {
366
- margin-bottom: 8px;
367
- }
368
- }
369
- }
370
-
371
- // Alignment variations
372
- &--center {
373
- justify-content: center;
374
- }
375
-
376
- &--end {
377
- justify-content: flex-end;
378
- }
379
-
380
- &--space-between {
381
- justify-content: space-between;
382
- }
383
- }
384
-
385
- // State classes
386
- &--state-disabled {
387
- opacity: 0.38; // Use mtrl standard opacity
388
- pointer-events: none;
389
- }
390
-
391
- &--state-loading {
392
- pointer-events: none;
393
- }
394
-
395
- // Elevation while dragged differs by variant, so it is set with each of them
396
- // above. The 0.9 opacity that used to be here is in no token.
397
- &--dragging {
398
- cursor: grabbing;
399
- }
400
-
401
- // Loading overlay
402
- &__loading-overlay {
403
- position: absolute;
404
- top: 0;
405
- left: 0;
406
- width: 100%;
407
- height: 100%;
408
- display: flex;
409
- align-items: center;
410
- justify-content: center;
411
- background-color: t.alpha('surface', 0.7);
412
- z-index: f.get-z-index('default');
413
- }
414
-
415
- &__loading-spinner {
416
- width: 40px;
417
- height: 40px;
418
- border-radius: 50%;
419
- border: 3px solid t.alpha('primary', 0.2);
420
- border-top-color: t.color('primary');
421
- animation: card-spinner 1s infinite linear;
422
- }
423
-
424
- // Expandable content
425
- &__expandable-content {
426
- overflow: hidden;
427
- transition: max-height f.get-motion-duration('medium1') f.get-motion-easing('standard');
428
- }
429
-
430
- &__expand-button {
431
- background: none;
432
- border: none;
433
- padding: 8px;
434
- cursor: pointer;
435
- color: t.color('primary');
436
- display: inline-flex;
437
- align-items: center;
438
- justify-content: center;
439
-
440
- &::before {
441
- content: '';
442
- display: inline-block;
443
- width: 10px;
444
- height: 10px;
445
- border-right: 2px solid currentColor;
446
- border-bottom: 2px solid currentColor;
447
- transform: rotate(45deg);
448
- transition: transform f.get-motion-duration('short2') f.get-motion-easing('standard');
449
- }
450
-
451
- &[aria-expanded="true"]::before {
452
- transform: rotate(-135deg);
453
- }
454
- }
455
-
456
- // Swipeable card
457
- &--swipeable {
458
- touch-action: pan-y;
459
- transition: transform f.get-motion-duration('medium1') f.get-motion-easing('standard');
460
- }
461
-
462
- // Hidden buttons for accessibility
463
- &__swipe-left-action,
464
- &__swipe-right-action {
465
- @include m.visually-hidden; // Use visually-hidden mixin
466
- }
467
- }
468
-
469
- // Spinner animation
470
- @keyframes card-spinner {
471
- 0% {
472
- transform: rotate(0deg);
473
- }
474
- 100% {
475
- transform: rotate(360deg);
476
- }
477
- }
478
-
479
- // Media query for responsive adjustments
10
+ position: relative;
11
+ display: flex;
12
+ flex-direction: column;
13
+ box-sizing: border-box;
14
+ border-radius: f.get-shape('medium');
15
+ background-color: t.color('surface');
16
+ color: t.color('on-surface');
17
+ overflow: hidden;
18
+ @include m.typography('body-medium');
19
+
20
+ @include m.motion-transition(
21
+ box-shadow,
22
+ background-color,
23
+ border-color
24
+ );
25
+
26
+ &:focus-visible {
27
+ @include m.focus-ring(t.color('secondary'));
28
+ }
29
+
30
+ &--focused {
31
+ @include m.focus-ring(t.color('secondary'));
32
+ }
33
+
34
+ .ripple {
35
+ position: absolute;
36
+ border-radius: 50%;
37
+ transform: scale(0);
38
+ pointer-events: none;
39
+ background-color: currentColor;
40
+ opacity: f.get-state-opacity('hover');
41
+ }
42
+
43
+ > :not(:last-child) {
44
+ margin-bottom: 0;
45
+ }
46
+
47
+
48
+ &--elevated {
49
+ background-color: t.color('surface-container-low');
50
+ @include m.elevation(1);
51
+
52
+ &:hover.#{$component}--interactive {
53
+ @include m.elevation(2);
54
+ }
55
+
56
+ &:active.#{$component}--interactive {
57
+ @include m.elevation(1);
58
+ @include m.state-layer(t.color('on-surface'), 'pressed');
59
+ }
60
+
61
+ &.#{$component}--dragging {
62
+ @include m.elevation(4);
63
+ }
64
+
65
+ &.#{$component}--state-disabled {
66
+ background-color: t.color('surface');
67
+ @include m.elevation(1);
68
+ }
69
+ }
70
+
71
+ &--filled {
72
+ background-color: t.color('surface-container-highest');
73
+ @include m.elevation(0);
74
+
75
+ &:hover.#{$component}--interactive {
76
+ @include m.elevation(1);
77
+ @include m.state-layer(t.color('on-surface'), 'hover');
78
+ }
79
+
80
+ &:active.#{$component}--interactive {
81
+ @include m.elevation(0);
82
+ @include m.state-layer(t.color('on-surface'), 'pressed');
83
+ }
84
+
85
+ &.#{$component}--dragging {
86
+ @include m.elevation(3);
87
+ }
88
+
89
+ &.#{$component}--state-disabled {
90
+ background-color: t.color('surface-variant');
91
+ }
92
+ }
93
+
94
+ &--outlined {
95
+ border: 1px solid t.color('outline-variant');
96
+ background-color: t.color('surface');
97
+ @include m.elevation(0);
98
+
99
+ &:hover.#{$component}--interactive {
100
+ @include m.elevation(1);
101
+ @include m.state-layer(t.color('on-surface'), 'hover');
102
+ border-color: t.color('outline-variant');
103
+ }
104
+
105
+ &:focus-visible,
106
+ &.#{$component}--focused {
107
+ border-color: t.color('on-surface');
108
+ }
109
+
110
+ &:active.#{$component}--interactive {
111
+ @include m.elevation(0);
112
+ @include m.state-layer(t.color('on-surface'), 'pressed');
113
+ border-color: t.color('outline-variant');
114
+ }
115
+
116
+ &.#{$component}--dragging {
117
+ @include m.elevation(3);
118
+ }
119
+
120
+ &.#{$component}--state-disabled {
121
+ border-color: t.alpha('outline', 0.12);
122
+ }
123
+ }
124
+
125
+
126
+ &--interactive {
127
+ cursor: pointer;
128
+ user-select: none;
129
+ }
130
+
131
+ &--full-width {
132
+ width: 100%;
133
+ }
134
+
135
+ &--small {
136
+ width: v.card('width-small');
137
+ }
138
+
139
+ &--medium {
140
+ width: v.card('width-medium');
141
+ }
142
+
143
+ &--large {
144
+ width: v.card('width-large');
145
+ }
146
+
147
+
148
+ &__header {
149
+ display: flex;
150
+ align-items: center;
151
+ padding: v.card('padding');
152
+ padding-bottom: 0;
153
+
154
+ &:last-child {
155
+ padding-bottom: v.card('padding');
156
+ }
157
+
158
+ &-avatar {
159
+ margin-right: v.card('padding');
160
+ @include m.rtl {
161
+ margin-right: 0;
162
+ margin-left: v.card('padding');
163
+ }
164
+ flex-shrink: 0;
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+
169
+ img {
170
+ width: 40px;
171
+ height: 40px;
172
+ border-radius: 50%;
173
+ object-fit: cover;
174
+ }
175
+ }
176
+
177
+ &-text {
178
+ flex: 1;
179
+ overflow: hidden;
180
+ }
181
+
182
+ &-title {
183
+ margin: 0;
184
+ @include m.typography('title-large');
185
+ @include m.truncate;
186
+ color: t.color('on-surface');
187
+ }
188
+
189
+ &-subtitle {
190
+ margin: 0;
191
+ @include m.typography('body-medium');
192
+ @include m.truncate;
193
+ color: t.color('on-surface-variant');
194
+ }
195
+
196
+ &-action {
197
+ margin-left: 8px;
198
+ @include m.rtl {
199
+ margin-left: 0;
200
+ margin-right: 8px;
201
+ }
202
+ flex-shrink: 0;
203
+ }
204
+ }
205
+
206
+ &__media {
207
+ position: relative;
208
+ overflow: hidden;
209
+ border-radius: f.get-shape('medium');
210
+ &-img {
211
+ display: block;
212
+ width: 100%;
213
+ object-fit: cover;
214
+ }
215
+
216
+ &--16-9 {
217
+ aspect-ratio: 16 / 9;
218
+
219
+ img {
220
+ height: 100%;
221
+ }
222
+ }
223
+
224
+ &--4-3 {
225
+ aspect-ratio: 4 / 3;
226
+
227
+ img {
228
+ height: 100%;
229
+ }
230
+ }
231
+
232
+ &--1-1 {
233
+ aspect-ratio: 1 / 1;
234
+
235
+ img {
236
+ height: 100%;
237
+ }
238
+ }
239
+
240
+ &--contain {
241
+ img {
242
+ object-fit: contain;
243
+ }
244
+ }
245
+ }
246
+
247
+ &__content {
248
+ padding: v.card('padding');
249
+ flex: 1 1 auto;
250
+
251
+ > *:first-child {
252
+ margin-top: 0;
253
+ }
254
+
255
+ > *:last-child {
256
+ margin-bottom: 0;
257
+ }
258
+
259
+ .#{$component}__media + &:not(.#{$component}__content--no-padding) {
260
+ padding-top: v.card('padding');
261
+ }
262
+
263
+ &--no-padding {
264
+ padding: 0;
265
+ }
266
+ }
267
+
268
+ &__actions {
269
+ display: flex;
270
+ flex-wrap: wrap;
271
+ padding: 8px;
272
+ align-items: center;
273
+
274
+ > * {
275
+ margin: 0 4px;
276
+
277
+ &:first-child {
278
+ margin-left: 8px;
279
+ }
280
+
281
+ &:last-child {
282
+ margin-right: 8px;
283
+ }
284
+
285
+ @include m.rtl {
286
+ &:first-child {
287
+ margin-left: 4px;
288
+ margin-right: 8px;
289
+ }
290
+
291
+ &:last-child {
292
+ margin-right: 4px;
293
+ margin-left: 8px;
294
+ }
295
+ }
296
+ }
297
+
298
+ &--full-bleed {
299
+ padding: 0;
300
+
301
+ > * {
302
+ margin: 0;
303
+ border-radius: 0;
304
+ flex: 1 1 auto;
305
+
306
+ &:first-child {
307
+ margin-left: 0;
308
+ }
309
+
310
+ &:last-child {
311
+ margin-right: 0;
312
+ }
313
+ }
314
+ }
315
+
316
+ &--vertical {
317
+ flex-direction: column;
318
+
319
+ > * {
320
+ width: 100%;
321
+ margin: 4px 0;
322
+
323
+ &:first-child {
324
+ margin-top: 8px;
325
+ }
326
+
327
+ &:last-child {
328
+ margin-bottom: 8px;
329
+ }
330
+ }
331
+ }
332
+
333
+ &--center {
334
+ justify-content: center;
335
+ }
336
+
337
+ &--end {
338
+ justify-content: flex-end;
339
+ }
340
+
341
+ &--space-between {
342
+ justify-content: space-between;
343
+ }
344
+ }
345
+
346
+ &--state-disabled {
347
+ opacity: 0.38;
348
+ pointer-events: none;
349
+ }
350
+
351
+ &--dragging {
352
+ cursor: grabbing;
353
+ }
354
+ }
355
+
480
356
  @include m.breakpoint-down('sm') {
481
- .#{$component} {
482
- width: 100%; // Full width on small screens
483
- }
357
+ .#{$component} {
358
+ width: 100%;
359
+ }
484
360
  }