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/styles/components/_dialog.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;
@@ -7,585 +6,461 @@
7
6
 
8
7
  $component: "#{base.$prefix}-dialog";
9
8
 
10
- // Dialog overlay (background scrim)
11
- // MD3 specifies 32% opacity for scrim
12
9
  .#{$component}__overlay {
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- right: 0;
17
- bottom: 0;
18
- background-color: transparent;
19
- visibility: hidden;
20
- z-index: v.z-index("modal");
21
- display: flex;
22
- align-items: center;
23
- justify-content: center;
24
- overflow: auto;
25
- padding: 24px;
26
- box-sizing: border-box;
27
-
28
- // Inside a container that holds it, the scrim covers the container, not
29
- // the viewport. A collapsed or smaller container keeps this fixed scrim:
30
- // the dialog carries the class only while its container has room
31
- // (dialog/features.ts).
32
- &--contained {
33
- position: absolute;
34
- }
35
-
36
- // The scrim fades on its own colour rather than on opacity: the dialog is
37
- // its child, so fading the layer faded the dialog with it, and the two
38
- // opacities multiplied into what read as a cut.
39
- // material-web animates the scrim linearly, 500ms in and 150ms out
40
- // (dialog/internal/animations.ts).
41
- transition:
42
- background-color v.motion("duration-short3") linear,
43
- visibility 0s linear v.motion("duration-short3");
44
-
45
- &--visible {
46
- background-color: t.alpha("scrim", 0.32);
47
- visibility: visible;
48
- transition: background-color v.motion("duration-long2") linear, visibility 0s;
49
- }
50
- }
51
-
52
- // Dialog container
53
- // MD3: surface-container-high, 28dp corners, elevation 3
54
- //
55
- // Motion follows material-web, the Material web implementation
56
- // (dialog/internal/animations.ts): the surface grows in height, 35% to 100%
57
- // over 500ms emphasized, while the dialog slides down into place and the
58
- // headline, content and actions fade in one after another. Closing takes
59
- // 150ms on emphasized accelerate. The growth is a scale of the dialog's
60
- // height from its top, the motion the menu opens with.
10
+ position: fixed;
11
+ top: 0;
12
+ left: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ background-color: transparent;
16
+ visibility: hidden;
17
+ z-index: v.z-index("modal");
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ overflow: auto;
22
+ padding: 24px;
23
+ box-sizing: border-box;
24
+
25
+ &--contained {
26
+ position: absolute;
27
+ }
28
+
29
+ transition:
30
+ background-color v.motion("duration-short3") linear,
31
+ visibility 0s linear v.motion("duration-short3");
32
+
33
+ &--visible {
34
+ background-color: t.alpha("scrim", 0.32);
35
+ visibility: visible;
36
+ transition: background-color v.motion("duration-long2") linear, visibility 0s;
37
+ }
38
+ }
39
+
61
40
 
62
41
  .#{$component} {
63
- position: relative;
64
- background-color: t.color("surface-container-high");
65
- color: t.color("on-surface");
66
- border-radius: v.shape("extra-large"); // 28dp corner radius
67
- max-width: 560px;
68
- min-width: 280px;
69
- width: 100%;
70
- margin: auto;
71
- @include m.elevation(3);
72
-
73
- // Hidden: 35% of its height, lifted slightly, not yet painted
74
- transform-origin: top center;
75
- transform: translateY(-50px) scaleY(0.35);
76
- opacity: 0;
77
- pointer-events: none;
78
- transition:
79
- transform v.motion("duration-short3") v.motion("easing-emphasized-accelerate"),
80
- opacity v.motion("duration-short1") linear v.motion("duration-short2");
81
-
82
- // Its contents fade with the surface, and lead it on the way out
83
- .#{$component}__header,
84
- .#{$component}__content,
85
- .#{$component}__footer {
86
- opacity: 0;
87
- transition: opacity v.motion("duration-short2") linear;
88
- }
89
-
90
- // Visible state
91
- &--visible {
92
- transform: translateY(0) scaleY(1);
93
- opacity: 1;
94
- pointer-events: auto;
95
- transition:
96
- transform v.motion("duration-long2") v.motion("easing-emphasized"),
97
- opacity v.motion("duration-short1") linear;
98
-
99
- // The headline and content follow the surface, the actions last
100
- .#{$component}__header,
101
- .#{$component}__content {
102
- opacity: 1;
103
- transition: opacity v.motion("duration-medium1") linear v.motion("duration-short1");
104
- }
105
-
106
- .#{$component}__footer {
107
- opacity: 1;
108
- transition: opacity v.motion("duration-medium2") linear v.motion("duration-short3");
109
- }
110
- }
111
-
112
- // Size variants
113
- &--small {
114
- width: 80%;
115
- max-width: 360px;
116
- }
117
-
118
- &--medium {
119
- width: 90%;
120
- max-width: 560px;
121
- }
122
-
123
- // 560dp is the widest a basic dialog goes; past that the answer is a
124
- // full-screen dialog
125
- &--large {
126
- width: 95%;
127
- max-width: 560px;
128
- }
129
-
130
- &--fullwidth {
131
- width: 100%;
132
- max-width: none;
133
- margin: 24px;
134
- }
135
-
136
- &--fullscreen {
137
- width: 100%;
138
- height: 100%;
139
- max-width: none;
140
- max-height: none;
141
- margin: 0;
142
- border-radius: 0;
143
- transform-origin: center center;
144
- transform: translateY(24px);
145
-
146
- &.#{$component}--visible {
147
- transform: translateY(0);
148
- }
149
- }
150
-
151
- // The variants change where the dialog comes from; it grows in height
152
- // either way, which is the M3 motion
153
- &--slide-up {
154
- transform: translateY(24px) scaleY(0.35);
155
-
156
- &.#{$component}--visible {
157
- transform: translateY(0) scaleY(1);
158
- }
159
- }
160
-
161
- &--slide-down {
162
- transform: translateY(-24px) scaleY(0.35);
163
-
164
- &.#{$component}--visible {
165
- transform: translateY(0) scaleY(1);
166
- }
167
- }
168
-
169
- &--fade {
170
- transform: none;
171
-
172
- &.#{$component}--visible {
173
- transform: none;
174
- }
175
- }
176
-
177
- // The basic dialog of the previous spec: a scale rather than a slide
178
- &--scale {
179
- transform-origin: center center;
180
- transform: scale(0.8);
181
-
182
- &.#{$component}--visible {
183
- transform: scale(1);
184
- }
185
- }
186
- }
187
-
188
- // layer: "top": the dialog is a <dialog> the browser shows in the top layer
189
- // with showModal(). This undoes the user agent's dialog box and centres it
190
- // within the 24px the overlay pads by, and the scrim is its ::backdrop, which
191
- // fades as the overlay did. Closing, `display` and `overlay` change at the end
192
- // of the transition (allow-discrete), so it animates out in the top layer.
42
+ position: relative;
43
+ background-color: t.color("surface-container-high");
44
+ color: t.color("on-surface");
45
+ border-radius: v.shape("extra-large");
46
+ max-width: 560px;
47
+ min-width: 280px;
48
+ width: 100%;
49
+ margin: auto;
50
+ @include m.elevation(3);
51
+
52
+ transform-origin: top center;
53
+ transform: translateY(-50px) scaleY(0.35);
54
+ opacity: 0;
55
+ pointer-events: none;
56
+ transition:
57
+ transform v.motion("duration-short3") v.motion("easing-emphasized-accelerate"),
58
+ opacity v.motion("duration-short1") linear v.motion("duration-short2");
59
+
60
+ .#{$component}__header,
61
+ .#{$component}__content,
62
+ .#{$component}__footer {
63
+ opacity: 0;
64
+ transition: opacity v.motion("duration-short2") linear;
65
+ }
66
+
67
+ &--visible {
68
+ transform: translateY(0) scaleY(1);
69
+ opacity: 1;
70
+ pointer-events: auto;
71
+ transition:
72
+ transform v.motion("duration-long2") v.motion("easing-emphasized"),
73
+ opacity v.motion("duration-short1") linear;
74
+
75
+ .#{$component}__header,
76
+ .#{$component}__content {
77
+ opacity: 1;
78
+ transition: opacity v.motion("duration-medium1") linear v.motion("duration-short1");
79
+ }
80
+
81
+ .#{$component}__footer {
82
+ opacity: 1;
83
+ transition: opacity v.motion("duration-medium2") linear v.motion("duration-short3");
84
+ }
85
+ }
86
+
87
+ &--small {
88
+ width: 80%;
89
+ max-width: 360px;
90
+ }
91
+
92
+ &--medium {
93
+ width: 90%;
94
+ max-width: 560px;
95
+ }
96
+
97
+ &--large {
98
+ width: 95%;
99
+ max-width: 560px;
100
+ }
101
+
102
+ &--fullwidth {
103
+ width: 100%;
104
+ max-width: none;
105
+ margin: 24px;
106
+ }
107
+
108
+ &--fullscreen {
109
+ width: 100%;
110
+ height: 100%;
111
+ max-width: none;
112
+ max-height: none;
113
+ margin: 0;
114
+ border-radius: 0;
115
+ transform-origin: center center;
116
+ transform: translateY(24px);
117
+
118
+ &.#{$component}--visible {
119
+ transform: translateY(0);
120
+ }
121
+ }
122
+
123
+ &--slide-up {
124
+ transform: translateY(24px) scaleY(0.35);
125
+
126
+ &.#{$component}--visible {
127
+ transform: translateY(0) scaleY(1);
128
+ }
129
+ }
130
+
131
+ &--slide-down {
132
+ transform: translateY(-24px) scaleY(0.35);
133
+
134
+ &.#{$component}--visible {
135
+ transform: translateY(0) scaleY(1);
136
+ }
137
+ }
138
+
139
+ &--fade {
140
+ transform: none;
141
+
142
+ &.#{$component}--visible {
143
+ transform: none;
144
+ }
145
+ }
146
+
147
+ &--scale {
148
+ transform-origin: center center;
149
+ transform: scale(0.8);
150
+
151
+ &.#{$component}--visible {
152
+ transform: scale(1);
153
+ }
154
+ }
155
+ }
156
+
193
157
  dialog.#{$component} {
194
- position: fixed;
195
- inset: 0;
196
- height: fit-content;
197
- max-height: calc(100% - 48px);
198
- padding: 0;
199
- border: 0;
200
- overflow: visible;
201
- transition:
202
- transform v.motion("duration-short3") v.motion("easing-emphasized-accelerate"),
203
- opacity v.motion("duration-short1") linear v.motion("duration-short2"),
204
- display v.motion("duration-short3") allow-discrete,
205
- overlay v.motion("duration-short3") allow-discrete;
206
-
207
- // Open, it has no transform at all rather than an identity one: a transform
208
- // would make the dialog the containing block of fixed children, such as a
209
- // snackbar shown inside the topmost modal
210
- &.#{$component}--visible {
211
- transform: none;
212
- transition:
213
- transform v.motion("duration-long2") v.motion("easing-emphasized"),
214
- opacity v.motion("duration-short1") linear;
215
- }
216
-
217
- &.#{$component}--fullwidth {
218
- width: auto;
219
- }
220
-
221
- &.#{$component}--fullscreen {
222
- height: 100%;
223
- max-height: none;
224
- }
225
-
226
- &::backdrop {
227
- background-color: transparent;
228
- transition:
229
- background-color v.motion("duration-short3") linear,
230
- display v.motion("duration-short3") allow-discrete,
231
- overlay v.motion("duration-short3") allow-discrete;
232
- }
233
-
234
- &.#{$component}--visible::backdrop {
235
- background-color: t.alpha("scrim", 0.32);
236
- transition: background-color v.motion("duration-long2") linear;
237
- }
238
- }
239
-
240
- // Dialog icon (optional, MD3 spec)
241
- // Centered above headline, 24dp, secondary color
242
- .#{$component}__icon {
243
- display: flex;
244
- align-items: center;
245
- justify-content: center;
246
- padding: 24px 24px 0 24px;
247
- color: t.color("secondary");
248
-
249
- svg,
250
- .#{$component}__icon-content {
251
- width: 24px;
252
- height: 24px;
253
- }
254
-
255
- // When icon is present, header should be centered
256
- & + .#{$component}__header {
257
- .#{$component}__header-content {
258
- text-align: center;
259
- }
260
-
261
- .#{$component}__header-title {
262
- text-align: center;
263
- }
264
-
265
- .#{$component}__header-subtitle {
266
- text-align: center;
267
- }
268
- }
269
- }
270
-
271
- // Dialog header
158
+ position: fixed;
159
+ inset: 0;
160
+ height: fit-content;
161
+ max-height: calc(100% - 48px);
162
+ padding: 0;
163
+ border: 0;
164
+ overflow: visible;
165
+ transition:
166
+ transform v.motion("duration-short3") v.motion("easing-emphasized-accelerate"),
167
+ opacity v.motion("duration-short1") linear v.motion("duration-short2"),
168
+ display v.motion("duration-short3") allow-discrete,
169
+ overlay v.motion("duration-short3") allow-discrete;
170
+
171
+ &.#{$component}--visible {
172
+ transform: none;
173
+ transition:
174
+ transform v.motion("duration-long2") v.motion("easing-emphasized"),
175
+ opacity v.motion("duration-short1") linear;
176
+ }
177
+
178
+ &.#{$component}--fullwidth {
179
+ width: auto;
180
+ }
181
+
182
+ &.#{$component}--fullscreen {
183
+ height: 100%;
184
+ max-height: none;
185
+ }
186
+
187
+ &::backdrop {
188
+ background-color: transparent;
189
+ transition:
190
+ background-color v.motion("duration-short3") linear,
191
+ display v.motion("duration-short3") allow-discrete,
192
+ overlay v.motion("duration-short3") allow-discrete;
193
+ }
194
+
195
+ &.#{$component}--visible::backdrop {
196
+ background-color: t.alpha("scrim", 0.32);
197
+ transition: background-color v.motion("duration-long2") linear;
198
+ }
199
+ }
200
+
272
201
  .#{$component}__header {
273
- display: flex;
274
- align-items: flex-start;
275
- justify-content: space-between;
276
- padding: 24px 24px 16px 24px;
277
-
278
- // When following an icon, reduce top padding
279
- .#{$component}__icon + & {
280
- padding-top: 16px;
281
- }
282
-
283
- &-content {
284
- flex: 1;
285
- }
286
-
287
- &-title {
288
- margin: 0;
289
- color: t.color("on-surface");
290
- @include m.typography("headline-small");
291
- }
292
-
293
- &-subtitle {
294
- margin: 4px 0 0 0;
295
- @include m.typography("body-medium");
296
- color: t.color("on-surface-variant");
297
- }
298
-
299
- &-close {
300
- font: inherit;
301
- display: flex;
302
- align-items: center;
303
- justify-content: center;
304
- width: 40px;
305
- height: 40px;
306
- margin: -8px -8px 0 0;
307
- padding: 8px;
308
- background: transparent;
309
- border: none;
310
- border-radius: 50%;
311
- cursor: pointer;
312
- color: t.color("on-surface-variant");
313
- transition: background-color v.motion("duration-short2")
314
- v.motion("easing-standard");
315
-
316
- &:hover {
317
- background-color: t.alpha("on-surface", 0.08);
318
- }
319
-
320
- &:focus {
321
- outline: none;
322
- background-color: t.alpha("on-surface", v.state("focus-state-layer-opacity"));
323
- }
324
-
325
- &:focus-visible {
326
- outline: 2px solid t.color("primary");
327
- outline-offset: 2px;
328
- }
329
-
330
- &:active {
331
- background-color: t.alpha("on-surface", v.state("pressed-state-layer-opacity"));
332
- }
333
-
334
- svg {
335
- width: 24px;
336
- height: 24px;
337
- }
338
-
339
- // The 40px button carries a 48px target, the icon button's own
340
- // mechanism (its --xs/--s ::after): the box reaches 4px past each edge.
341
- // m3.material.io, Density: "The default target size should be at least
342
- // 48x48 CSS pixels".
343
- position: relative;
344
-
345
- &::after {
346
- content: "";
347
- position: absolute;
348
- width: 48px;
349
- height: 48px;
350
- top: 50%;
351
- left: 50%;
352
- transform: translate(-50%, -50%);
353
- }
354
- }
355
-
356
- // RTL Support
357
- @include m.rtl-selector('.#{$component}__header-close') {
358
- margin: -8px 0 0 -8px;
359
- }
360
- }
361
-
362
- // Dialog content
363
- // MD3: Body medium typography, on-surface-variant for supporting text
202
+ display: flex;
203
+ align-items: flex-start;
204
+ justify-content: space-between;
205
+ padding: 24px 24px 16px 24px;
206
+
207
+ &-content {
208
+ flex: 1;
209
+ }
210
+
211
+ &-title {
212
+ margin: 0;
213
+ color: t.color("on-surface");
214
+ @include m.typography("headline-small");
215
+ }
216
+
217
+ &-subtitle {
218
+ margin: 4px 0 0 0;
219
+ @include m.typography("body-medium");
220
+ color: t.color("on-surface-variant");
221
+ }
222
+
223
+ &-close {
224
+ font: inherit;
225
+ display: flex;
226
+ align-items: center;
227
+ justify-content: center;
228
+ width: 40px;
229
+ height: 40px;
230
+ margin: -8px -8px 0 0;
231
+ padding: 8px;
232
+ background: transparent;
233
+ border: none;
234
+ border-radius: 50%;
235
+ cursor: pointer;
236
+ color: t.color("on-surface-variant");
237
+ transition: background-color v.motion("duration-short2")
238
+ v.motion("easing-standard");
239
+
240
+ &:hover {
241
+ background-color: t.alpha("on-surface", 0.08);
242
+ }
243
+
244
+ &:focus {
245
+ outline: none;
246
+ background-color: t.alpha("on-surface", v.state("focus-state-layer-opacity"));
247
+ }
248
+
249
+ &:focus-visible {
250
+ outline: 2px solid t.color("primary");
251
+ outline-offset: 2px;
252
+ }
253
+
254
+ &:active {
255
+ background-color: t.alpha("on-surface", v.state("pressed-state-layer-opacity"));
256
+ }
257
+
258
+ svg {
259
+ width: 24px;
260
+ height: 24px;
261
+ }
262
+
263
+ position: relative;
264
+
265
+ &::after {
266
+ content: "";
267
+ position: absolute;
268
+ width: 48px;
269
+ height: 48px;
270
+ top: 50%;
271
+ left: 50%;
272
+ transform: translate(-50%, -50%);
273
+ }
274
+ }
275
+
276
+ @include m.rtl-selector('.#{$component}__header-close') {
277
+ margin: -8px 0 0 -8px;
278
+ }
279
+ }
280
+
364
281
  .#{$component}__header:empty {
365
- display: none;
282
+ display: none;
366
283
  }
367
284
 
368
285
  .#{$component}__header:not(:has(*)) + .#{$component}__content,
369
286
  .#{$component} > .#{$component}__content:first-child {
370
- padding-top: 24px;
287
+ padding-top: 24px;
371
288
  }
372
289
 
373
290
  .#{$component}__content {
374
- // The gaps above and below belong to the header and the footer, so that
375
- // title to body is 16dp and body to actions is 24dp, counted once
376
- padding: 0 24px;
377
- color: t.color("on-surface-variant");
378
- @include m.typography("body-medium");
379
-
380
- // Allow dropdowns/select menus to overflow the dialog
381
- overflow: visible;
382
-
383
- // Scrollable content variant (opt-in)
384
- &--scrollable {
385
- overflow-y: auto;
386
- max-height: 60vh;
387
- @include m.scrollbar;
388
- }
389
-
390
- p {
391
- margin: 0 0 16px 0;
392
-
393
- &:last-child {
394
- margin-bottom: 0;
395
- }
396
- }
397
-
398
- // When content needs emphasis, use on-surface
399
- &--emphasis {
400
- color: t.color("on-surface");
401
- }
402
-
403
- &:last-child {
404
- padding-bottom: 24px;
405
- }
406
- }
407
-
408
- // Dialog footer
409
- // MD3: Actions right-aligned, 8dp gap, text buttons preferred
291
+ padding: 0 24px;
292
+ color: t.color("on-surface-variant");
293
+ @include m.typography("body-medium");
294
+
295
+ overflow: visible;
296
+
297
+ p {
298
+ margin: 0 0 16px 0;
299
+
300
+ &:last-child {
301
+ margin-bottom: 0;
302
+ }
303
+ }
304
+
305
+ &:last-child {
306
+ padding-bottom: 24px;
307
+ }
308
+ }
309
+
410
310
  .#{$component}__footer {
411
- display: flex;
412
- align-items: center;
413
- justify-content: flex-end;
414
- padding: 24px 24px 24px 24px;
415
- gap: 8px;
416
-
417
- &--left {
418
- justify-content: flex-start;
419
- }
420
-
421
- &--center {
422
- justify-content: center;
423
- }
424
-
425
- &--space-between {
426
- justify-content: space-between;
427
- }
428
-
429
- // Stacked buttons for long text (MD3 spec)
430
- &--stacked {
431
- flex-direction: column-reverse;
432
- align-items: stretch;
433
- gap: 8px;
434
- }
435
- }
436
-
437
- // Dialog divider styling
438
- // MD3: outline-variant color for dividers
439
- // -----------------------------------------------------------------------------
440
- // Full-screen dialog: a 56dp header carrying the close affordance and the
441
- // headline, and a 56dp action bar at the bottom. For compact windows only;
442
- // wider ones take a basic dialog.
443
- // -----------------------------------------------------------------------------
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: flex-end;
314
+ padding: 24px 24px 24px 24px;
315
+ gap: 8px;
316
+
317
+ &--left {
318
+ justify-content: flex-start;
319
+ }
320
+
321
+ &--center {
322
+ justify-content: center;
323
+ }
324
+
325
+ &--space-between {
326
+ justify-content: space-between;
327
+ }
328
+
329
+ &--stacked {
330
+ flex-direction: column-reverse;
331
+ align-items: stretch;
332
+ gap: 8px;
333
+ }
334
+ }
335
+
444
336
  .#{$component}--fullscreen {
445
- .#{$component}__header {
446
- display: flex;
447
- align-items: center;
448
- min-height: 56px;
449
- padding: 0 24px;
450
- gap: 8px;
451
- }
452
-
453
- // The close affordance leads, the headline follows it
454
- .#{$component}__header-close {
455
- order: -1;
456
- margin: 0 0 0 -8px;
457
-
458
- @include m.rtl {
459
- margin: 0 -8px 0 0;
460
- }
461
- }
462
-
463
- .#{$component}__header-title {
464
- @include m.typography("title-large");
465
- text-align: start;
466
- }
467
-
468
- .#{$component}__content {
469
- flex: 1;
470
- overflow-y: auto;
471
- padding: 24px;
472
- }
473
-
474
- .#{$component}__footer {
475
- min-height: 56px;
476
- padding: 0 24px;
477
- box-sizing: border-box;
478
- }
479
-
480
- display: flex;
481
- flex-direction: column;
337
+ .#{$component}__header {
338
+ display: flex;
339
+ align-items: center;
340
+ min-height: 56px;
341
+ padding: 0 24px;
342
+ gap: 8px;
343
+ }
344
+
345
+ .#{$component}__header-close {
346
+ order: -1;
347
+ margin: 0 0 0 -8px;
348
+
349
+ @include m.rtl {
350
+ margin: 0 -8px 0 0;
351
+ }
352
+ }
353
+
354
+ .#{$component}__header-title {
355
+ @include m.typography("title-large");
356
+ text-align: start;
357
+ }
358
+
359
+ .#{$component}__content {
360
+ flex: 1;
361
+ overflow-y: auto;
362
+ padding: 24px;
363
+ }
364
+
365
+ .#{$component}__footer {
366
+ min-height: 56px;
367
+ padding: 0 24px;
368
+ box-sizing: border-box;
369
+ }
370
+
371
+ display: flex;
372
+ flex-direction: column;
482
373
  }
483
374
 
484
375
  .#{$component}__header-divider,
485
376
  .#{$component}__footer-divider {
486
- margin: 0;
487
- border: none;
488
- height: 1px;
489
- background-color: t.color("outline-variant");
377
+ margin: 0;
378
+ border: none;
379
+ height: 1px;
380
+ background-color: t.color("outline-variant");
490
381
  }
491
382
 
492
- // Accessibility - Reduced motion preference support
493
383
  @include m.reduced-motion {
494
- .#{$component},
495
- .#{$component}--visible,
496
- .#{$component}__overlay,
497
- .#{$component}__overlay--visible {
498
- transition: opacity v.motion("duration-short2") linear;
499
- }
500
-
501
- .#{$component},
502
- .#{$component}--visible,
503
- .#{$component}--scale,
504
- .#{$component}--slide-up,
505
- .#{$component}--slide-down,
506
- .#{$component}--fullscreen {
507
- transform: none;
508
- }
509
- }
510
-
511
- // High contrast mode
384
+ .#{$component},
385
+ .#{$component}--visible,
386
+ .#{$component}__overlay,
387
+ .#{$component}__overlay--visible {
388
+ transition: opacity v.motion("duration-short2") linear;
389
+ }
390
+
391
+ .#{$component},
392
+ .#{$component}--visible,
393
+ .#{$component}--scale,
394
+ .#{$component}--slide-up,
395
+ .#{$component}--slide-down,
396
+ .#{$component}--fullscreen {
397
+ transform: none;
398
+ }
399
+ }
400
+
512
401
  @include m.high-contrast {
513
- .#{$component} {
514
- border: 2px solid CurrentColor;
515
- }
402
+ .#{$component} {
403
+ border: 2px solid CurrentColor;
404
+ }
516
405
 
517
- .#{$component}__header-divider,
518
- .#{$component}__footer-divider {
519
- background-color: CurrentColor;
520
- }
406
+ .#{$component}__header-divider,
407
+ .#{$component}__footer-divider {
408
+ background-color: CurrentColor;
409
+ }
521
410
 
522
- .#{$component}__header-close:focus-visible {
523
- outline: 2px solid CurrentColor;
524
- }
411
+ .#{$component}__header-close:focus-visible {
412
+ outline: 2px solid CurrentColor;
413
+ }
525
414
  }
526
415
 
527
- // Mobile responsiveness
528
- // MD3: Dialogs may become full-width sheets on mobile
529
416
  @media (max-width: v.breakpoint("sm")) {
530
- .#{$component} {
531
- min-width: 280px;
532
- width: calc(100% - 32px);
533
- max-width: 100%;
534
- margin: 16px;
535
-
536
- // Mobile dialogs animate from bottom
537
- transform-origin: bottom center;
538
-
539
- &--fullscreen {
540
- width: 100%;
541
- height: 100%;
542
- margin: 0;
543
- transform-origin: center center;
544
- }
545
- }
546
-
547
- .#{$component}__overlay {
548
- padding: 16px;
549
- align-items: flex-end;
550
-
551
- &.#{$component}--fullscreen {
552
- padding: 0;
553
- }
554
- }
555
-
556
- .#{$component}__content--scrollable {
557
- max-height: 50vh;
558
- }
559
-
560
- // Adjust animations for mobile - slide up from bottom
561
- .#{$component}--slide-up {
562
- transform: translateY(24px);
563
-
564
- &.#{$component}--visible {
565
- transform: translateY(0);
566
- }
567
- }
568
-
569
- // Stacked footer buttons on mobile when needed
570
- .#{$component}__footer--responsive {
571
- flex-direction: column-reverse;
572
- align-items: stretch;
573
- }
574
- }
575
-
576
- // Print styles
417
+ .#{$component} {
418
+ min-width: 280px;
419
+ width: calc(100% - 32px);
420
+ max-width: 100%;
421
+ margin: 16px;
422
+
423
+ transform-origin: bottom center;
424
+
425
+ &--fullscreen {
426
+ width: 100%;
427
+ height: 100%;
428
+ margin: 0;
429
+ transform-origin: center center;
430
+ }
431
+ }
432
+
433
+ .#{$component}__overlay {
434
+ padding: 16px;
435
+ align-items: flex-end;
436
+ }
437
+
438
+ .#{$component}--slide-up {
439
+ transform: translateY(24px);
440
+
441
+ &.#{$component}--visible {
442
+ transform: translateY(0);
443
+ }
444
+ }
445
+
446
+ .#{$component}__footer--responsive {
447
+ flex-direction: column-reverse;
448
+ align-items: stretch;
449
+ }
450
+ }
451
+
577
452
  @media print {
578
- .#{$component}__overlay {
579
- position: static;
580
- background: none;
581
- padding: 0;
582
- }
583
-
584
- .#{$component} {
585
- box-shadow: none;
586
- border: 1px solid #000;
587
- max-width: 100%;
588
- transform: none;
589
- opacity: 1;
590
- }
453
+ .#{$component}__overlay {
454
+ position: static;
455
+ background: none;
456
+ padding: 0;
457
+ }
458
+
459
+ .#{$component} {
460
+ box-shadow: none;
461
+ border: 1px solid #000;
462
+ max-width: 100%;
463
+ transform: none;
464
+ opacity: 1;
465
+ }
591
466
  }