material 3.7.2 → 3.8.0

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 (313) hide show
  1. package/NOTICE +223 -0
  2. package/README.md +5 -3
  3. package/dist/components/extended-fab/types.d.ts +3 -0
  4. package/dist/components/fab/types.d.ts +3 -0
  5. package/dist/components/slider/features/controller.js +24 -8
  6. package/dist/elements/css/card.css +1 -1
  7. package/dist/elements/css/card.js +1 -1
  8. package/dist/elements/css/dialog.css +1 -1
  9. package/dist/elements/css/dialog.js +1 -1
  10. package/dist/elements/css/menu.css +1 -1
  11. package/dist/elements/css/menu.js +1 -1
  12. package/dist/elements/css/select.css +1 -1
  13. package/dist/elements/css/select.js +1 -1
  14. package/dist/elements/css/slider.css +1 -1
  15. package/dist/elements/css/slider.js +1 -1
  16. package/dist/elements/css/tabs.css +1 -1
  17. package/dist/elements/css/tabs.js +1 -1
  18. package/dist/elements/css/timepicker.css +1 -1
  19. package/dist/elements/css/timepicker.js +1 -1
  20. package/dist/elements/extended-fab.d.ts +1 -0
  21. package/dist/elements/fab.d.ts +1 -0
  22. package/dist/elements/preupgrade/badge.css +1 -1
  23. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  24. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  25. package/dist/elements/preupgrade/button-group.css +1 -1
  26. package/dist/elements/preupgrade/button.css +1 -1
  27. package/dist/elements/preupgrade/card.css +1 -1
  28. package/dist/elements/preupgrade/carousel.css +1 -1
  29. package/dist/elements/preupgrade/checkbox.css +1 -1
  30. package/dist/elements/preupgrade/chips.css +1 -1
  31. package/dist/elements/preupgrade/datepicker.css +1 -1
  32. package/dist/elements/preupgrade/dialog.css +1 -1
  33. package/dist/elements/preupgrade/divider.css +1 -1
  34. package/dist/elements/preupgrade/drawer.css +1 -1
  35. package/dist/elements/preupgrade/extended-fab.css +1 -1
  36. package/dist/elements/preupgrade/fab-menu.css +1 -1
  37. package/dist/elements/preupgrade/fab.css +1 -1
  38. package/dist/elements/preupgrade/icon-button.css +1 -1
  39. package/dist/elements/preupgrade/list.css +1 -1
  40. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  41. package/dist/elements/preupgrade/menu.css +1 -1
  42. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  43. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  44. package/dist/elements/preupgrade/progress.css +1 -1
  45. package/dist/elements/preupgrade/radios.css +1 -1
  46. package/dist/elements/preupgrade/search.css +1 -1
  47. package/dist/elements/preupgrade/select.css +1 -1
  48. package/dist/elements/preupgrade/side-sheet.css +1 -1
  49. package/dist/elements/preupgrade/slider.css +1 -1
  50. package/dist/elements/preupgrade/snackbar.css +1 -1
  51. package/dist/elements/preupgrade/split-button.css +1 -1
  52. package/dist/elements/preupgrade/switch.css +1 -1
  53. package/dist/elements/preupgrade/tabs.css +1 -1
  54. package/dist/elements/preupgrade/text-field.css +1 -1
  55. package/dist/elements/preupgrade/timepicker.css +1 -1
  56. package/dist/elements/preupgrade/toolbar.css +1 -1
  57. package/dist/elements/preupgrade/tooltip.css +1 -1
  58. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  59. package/dist/elements/preupgrade.css +1 -1
  60. package/dist/styles/badge.css +1 -1
  61. package/dist/styles/base-lite.css +2 -2
  62. package/dist/styles/base.css +2 -2
  63. package/dist/styles/bottom-app-bar.css +1 -1
  64. package/dist/styles/bottom-sheet.css +1 -1
  65. package/dist/styles/button-group.css +1 -1
  66. package/dist/styles/button.css +1 -1
  67. package/dist/styles/card.css +2 -2
  68. package/dist/styles/carousel.css +1 -1
  69. package/dist/styles/checkbox.css +1 -1
  70. package/dist/styles/chips.css +1 -1
  71. package/dist/styles/contrast.css +2 -2
  72. package/dist/styles/datepicker.css +1 -1
  73. package/dist/styles/dialog.css +2 -2
  74. package/dist/styles/divider.css +1 -1
  75. package/dist/styles/drawer.css +1 -1
  76. package/dist/styles/extended-fab.css +1 -1
  77. package/dist/styles/fab-menu.css +1 -1
  78. package/dist/styles/fab.css +1 -1
  79. package/dist/styles/icon-button.css +1 -1
  80. package/dist/styles/list.css +1 -1
  81. package/dist/styles/loading-indicator.css +1 -1
  82. package/dist/styles/menu.css +2 -2
  83. package/dist/styles/navigation-bar.css +1 -1
  84. package/dist/styles/navigation-rail.css +1 -1
  85. package/dist/styles/progress.css +1 -1
  86. package/dist/styles/radios.css +1 -1
  87. package/dist/styles/search.css +1 -1
  88. package/dist/styles/select.css +2 -2
  89. package/dist/styles/side-sheet.css +1 -1
  90. package/dist/styles/slider.css +2 -2
  91. package/dist/styles/snackbar.css +1 -1
  92. package/dist/styles/split-button.css +1 -1
  93. package/dist/styles/switch.css +1 -1
  94. package/dist/styles/tabs.css +2 -2
  95. package/dist/styles/text-field.css +1 -1
  96. package/dist/styles/timepicker.css +2 -2
  97. package/dist/styles/toolbar.css +1 -1
  98. package/dist/styles/tooltip.css +1 -1
  99. package/dist/styles/top-app-bar.css +1 -1
  100. package/dist/styles/typography.css +1 -1
  101. package/dist/styles/utilities.css +1 -1
  102. package/dist/styles.css +2 -2
  103. package/dist/theme/image.d.ts +2 -0
  104. package/dist/theme/image.js +5 -0
  105. package/dist/theme/index.d.ts +23 -0
  106. package/dist/theme/index.js +32 -0
  107. package/dist/theme/roles.js +68 -0
  108. package/dist/theme/variants.d.ts +9 -0
  109. package/dist/theme/variants.js +17 -0
  110. package/dist/theme/vendor/contrast/contrast.js +72 -0
  111. package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
  112. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +63 -0
  113. package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
  114. package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
  115. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +24 -0
  116. package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
  117. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +87 -0
  118. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
  119. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +124 -0
  120. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
  121. package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
  122. package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
  123. package/dist/theme/vendor/hct/cam16.js +249 -0
  124. package/dist/theme/vendor/hct/hct.d.ts +23 -0
  125. package/dist/theme/vendor/hct/hct.js +86 -0
  126. package/dist/theme/vendor/hct/hct_solver.js +390 -0
  127. package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
  128. package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
  129. package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
  130. package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
  131. package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
  132. package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
  133. package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
  134. package/dist/theme/vendor/scheme/scheme_content.js +30 -0
  135. package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
  136. package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
  137. package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
  138. package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
  139. package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
  140. package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
  141. package/dist/theme/vendor/score/score.js +100 -0
  142. package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
  143. package/dist/theme/vendor/utils/color_utils.js +173 -0
  144. package/dist/theme/vendor/utils/image_utils.js +72 -0
  145. package/dist/theme/vendor/utils/math_utils.js +75 -0
  146. package/dist/theme/vendor/utils/string_utils.js +61 -0
  147. package/dist/themes/autumn-contrast.css +2 -2
  148. package/dist/themes/autumn.css +2 -2
  149. package/dist/themes/baseline-contrast.css +2 -2
  150. package/dist/themes/baseline.css +2 -2
  151. package/dist/themes/brownbeige-contrast.css +2 -2
  152. package/dist/themes/brownbeige.css +2 -2
  153. package/dist/themes/content-contrast.css +2 -2
  154. package/dist/themes/content.css +2 -2
  155. package/dist/themes/desert-contrast.css +2 -2
  156. package/dist/themes/desert.css +2 -2
  157. package/dist/themes/expressive-contrast.css +2 -2
  158. package/dist/themes/expressive.css +2 -2
  159. package/dist/themes/fidelity-contrast.css +2 -2
  160. package/dist/themes/fidelity.css +2 -2
  161. package/dist/themes/forest-contrast.css +2 -2
  162. package/dist/themes/forest.css +2 -2
  163. package/dist/themes/fruit-salad-contrast.css +2 -2
  164. package/dist/themes/fruit-salad.css +2 -2
  165. package/dist/themes/highcontrast-contrast.css +2 -2
  166. package/dist/themes/highcontrast.css +2 -2
  167. package/dist/themes/monochrome-contrast.css +2 -2
  168. package/dist/themes/monochrome.css +2 -2
  169. package/dist/themes/neutral-contrast.css +2 -2
  170. package/dist/themes/neutral.css +2 -2
  171. package/dist/themes/ocean-contrast.css +2 -2
  172. package/dist/themes/ocean.css +2 -2
  173. package/dist/themes/rainbow-contrast.css +2 -2
  174. package/dist/themes/rainbow.css +2 -2
  175. package/dist/themes/sageivory-contrast.css +2 -2
  176. package/dist/themes/sageivory.css +2 -2
  177. package/dist/themes/spring-contrast.css +2 -2
  178. package/dist/themes/spring.css +2 -2
  179. package/dist/themes/summer-contrast.css +2 -2
  180. package/dist/themes/summer.css +2 -2
  181. package/dist/themes/sunset-contrast.css +2 -2
  182. package/dist/themes/sunset.css +2 -2
  183. package/dist/themes/tealcaramel-contrast.css +2 -2
  184. package/dist/themes/tealcaramel.css +2 -2
  185. package/dist/themes/vibrant-contrast.css +2 -2
  186. package/dist/themes/vibrant.css +2 -2
  187. package/package.json +15 -1
  188. package/src/styles/abstract/_base.scss +0 -1
  189. package/src/styles/abstract/_direction.scss +121 -152
  190. package/src/styles/abstract/_emit.scss +7 -16
  191. package/src/styles/abstract/_floating-placement.scss +9 -10
  192. package/src/styles/abstract/_functions.scss +64 -79
  193. package/src/styles/abstract/_mixins.scss +355 -459
  194. package/src/styles/abstract/_theme.scss +122 -136
  195. package/src/styles/abstract/_variables.scss +320 -390
  196. package/src/styles/abstract/chips/_assist.scss +2 -3
  197. package/src/styles/abstract/chips/_filter.scss +2 -3
  198. package/src/styles/abstract/chips/_input.scss +2 -3
  199. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  200. package/src/styles/base/_body-theme.scss +10 -15
  201. package/src/styles/base/_document.scss +10 -33
  202. package/src/styles/base/_reset.scss +20 -40
  203. package/src/styles/base/_tokens.scss +6 -21
  204. package/src/styles/base/_typescale-tokens.scss +12 -16
  205. package/src/styles/base/_typography.scss +28 -37
  206. package/src/styles/components/_badge.scss +171 -193
  207. package/src/styles/components/_bottom-app-bar.scss +72 -90
  208. package/src/styles/components/_bottom-sheet.scss +188 -232
  209. package/src/styles/components/_button-group.scss +140 -189
  210. package/src/styles/components/_button.scss +382 -478
  211. package/src/styles/components/_card.scss +349 -473
  212. package/src/styles/components/_carousel.scss +134 -156
  213. package/src/styles/components/_checkbox.scss +208 -249
  214. package/src/styles/components/_chips.scss +239 -304
  215. package/src/styles/components/_datepicker.scss +172 -222
  216. package/src/styles/components/_dialog.scss +428 -553
  217. package/src/styles/components/_divider.scss +37 -46
  218. package/src/styles/components/_drawer.scss +571 -678
  219. package/src/styles/components/_extended-fab.scss +263 -294
  220. package/src/styles/components/_fab-menu.scss +225 -267
  221. package/src/styles/components/_fab.scss +197 -218
  222. package/src/styles/components/_icon-button.scss +483 -588
  223. package/src/styles/components/_list.scss +115 -144
  224. package/src/styles/components/_loading-indicator.scss +23 -29
  225. package/src/styles/components/_menu.scss +543 -699
  226. package/src/styles/components/_navigation-bar.scss +189 -234
  227. package/src/styles/components/_navigation-rail.scss +256 -312
  228. package/src/styles/components/_progress.scss +60 -85
  229. package/src/styles/components/_radios.scss +170 -207
  230. package/src/styles/components/_search.scss +369 -455
  231. package/src/styles/components/_select.scss +78 -185
  232. package/src/styles/components/_side-sheet.scss +234 -292
  233. package/src/styles/components/_slider.scss +289 -367
  234. package/src/styles/components/_snackbar.scss +149 -198
  235. package/src/styles/components/_split-button.scss +139 -228
  236. package/src/styles/components/_switch.scss +282 -349
  237. package/src/styles/components/_tabs.scss +350 -547
  238. package/src/styles/components/_text-field.scss +788 -980
  239. package/src/styles/components/_timepicker.scss +435 -506
  240. package/src/styles/components/_toolbar.scss +178 -242
  241. package/src/styles/components/_tooltip.scss +152 -197
  242. package/src/styles/components/_top-app-bar.scss +206 -230
  243. package/src/styles/elements/_badge.scss +42 -61
  244. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  245. package/src/styles/elements/_bottom-sheet.scss +0 -3
  246. package/src/styles/elements/_button-group.scss +80 -80
  247. package/src/styles/elements/_button.scss +72 -88
  248. package/src/styles/elements/_card.scss +48 -57
  249. package/src/styles/elements/_carousel.scss +2 -5
  250. package/src/styles/elements/_checkbox.scss +32 -43
  251. package/src/styles/elements/_chips.scss +18 -22
  252. package/src/styles/elements/_config.scss +11 -26
  253. package/src/styles/elements/_datepicker.scss +17 -22
  254. package/src/styles/elements/_dialog.scss +0 -3
  255. package/src/styles/elements/_divider.scss +11 -13
  256. package/src/styles/elements/_drawer.scss +9 -14
  257. package/src/styles/elements/_extended-fab.scss +36 -40
  258. package/src/styles/elements/_fab-menu.scss +21 -25
  259. package/src/styles/elements/_fab.scss +17 -20
  260. package/src/styles/elements/_field.scss +93 -114
  261. package/src/styles/elements/_icon-button.scss +34 -38
  262. package/src/styles/elements/_index.scss +0 -4
  263. package/src/styles/elements/_list.scss +19 -26
  264. package/src/styles/elements/_loading-indicator.scss +6 -9
  265. package/src/styles/elements/_menu.scss +0 -3
  266. package/src/styles/elements/_navigation-bar.scss +5 -9
  267. package/src/styles/elements/_navigation-rail.scss +10 -15
  268. package/src/styles/elements/_progress.scss +15 -18
  269. package/src/styles/elements/_radios.scss +24 -49
  270. package/src/styles/elements/_search.scss +19 -24
  271. package/src/styles/elements/_select.scss +4 -9
  272. package/src/styles/elements/_side-sheet.scss +0 -3
  273. package/src/styles/elements/_slider.scss +15 -35
  274. package/src/styles/elements/_snackbar.scss +0 -3
  275. package/src/styles/elements/_split-button.scss +33 -39
  276. package/src/styles/elements/_switch.scss +50 -90
  277. package/src/styles/elements/_tabs.scss +9 -13
  278. package/src/styles/elements/_text-field.scss +150 -178
  279. package/src/styles/elements/_timepicker.scss +0 -3
  280. package/src/styles/elements/_toolbar.scss +30 -35
  281. package/src/styles/elements/_tooltip.scss +0 -3
  282. package/src/styles/elements/_top-app-bar.scss +38 -45
  283. package/src/styles/main.scss +0 -15
  284. package/src/styles/themes/_autumn.scss +258 -258
  285. package/src/styles/themes/_base-theme.scss +112 -134
  286. package/src/styles/themes/_baseline.scss +291 -314
  287. package/src/styles/themes/_brownbeige.scss +270 -250
  288. package/src/styles/themes/_content.scss +268 -248
  289. package/src/styles/themes/_desert.scss +270 -250
  290. package/src/styles/themes/_expressive.scss +270 -250
  291. package/src/styles/themes/_fidelity.scss +268 -248
  292. package/src/styles/themes/_forest.scss +260 -259
  293. package/src/styles/themes/_fruit-salad.scss +270 -250
  294. package/src/styles/themes/_highcontrast.scss +183 -172
  295. package/src/styles/themes/_index.scss +0 -1
  296. package/src/styles/themes/_monochrome.scss +254 -234
  297. package/src/styles/themes/_neutral.scss +270 -250
  298. package/src/styles/themes/_ocean.scss +260 -259
  299. package/src/styles/themes/_rainbow.scss +270 -250
  300. package/src/styles/themes/_sageivory.scss +270 -250
  301. package/src/styles/themes/_spring.scss +256 -255
  302. package/src/styles/themes/_summer.scss +270 -250
  303. package/src/styles/themes/_sunset.scss +260 -259
  304. package/src/styles/themes/_tealcaramel.scss +270 -250
  305. package/src/styles/themes/_vibrant.scss +270 -250
  306. package/src/styles/utilities/_colors.scss +44 -50
  307. package/src/styles/utilities/_flexbox.scss +48 -59
  308. package/src/styles/utilities/_layout.scss +516 -591
  309. package/src/styles/utilities/_ripple.scss +61 -70
  310. package/src/styles/utilities/_spacing.scss +120 -127
  311. package/src/styles/utilities/_typography.scss +45 -58
  312. package/src/styles/utilities/_visibility.scss +61 -76
  313. package/dist/package.json +0 -488
@@ -1,14 +1,3 @@
1
- // src/styles/components/_fab-menu.scss
2
- //
3
- // M3 Expressive's FAB menu (m3.material.io FAB menu specs and guidelines;
4
- // Compose FloatingActionButtonMenu.kt and FabMenuBaselineTokens):
5
- // - list: the FAB turns into a 56dp round close button, pinned to its top
6
- // trailing corner, on the colour set's role; the items rise above it, 8dp
7
- // away and 4dp apart, pill-shaped, 56dp high, end-aligned, on the role's
8
- // container, nearest the FAB first. At bottom-start that corner, the list
9
- // and the items are pinned to the inline start instead, so they open into
10
- // the page; bottom-end keeps the end
11
- // - menu: the FAB stays; the baseline menu opens from it
12
1
  @use '../../styles/abstract/base' as base;
13
2
  @use '../../styles/abstract/variables' as v;
14
3
  @use '../../styles/abstract/functions' as f;
@@ -19,265 +8,234 @@
19
8
  $component: '#{base.$prefix}-fab-menu';
20
9
  $fab: '#{base.$prefix}-fab';
21
10
  $spatial: v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-easing');
22
- // Colours move on the same spring with its progress clamped, as Compose's
23
- // Color.lerp clamps it: an overshoot never takes a colour past its target
24
11
  $spatial-colour: v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-clamped-easing');
25
12
  $effects: v.motion('spring-fast-effects-duration') v.motion('spring-fast-effects-easing');
26
- // Where spring-fast-spatial crosses half its progress: the icon swaps there
27
- // (the Compose sample swaps it at checkedProgress 0.5)
28
13
  $swap: 48ms;
29
14
 
30
15
  .#{$component} {
31
- position: relative;
32
- display: inline-block;
33
- width: 56px;
34
- height: 56px;
35
- vertical-align: middle;
36
-
37
- &--medium {
38
- width: 80px;
39
- height: 80px;
40
- }
41
-
42
- &--large {
43
- width: 96px;
44
- height: 96px;
45
- }
46
-
47
- @each $role in primary, secondary, tertiary {
48
- &--#{$role} {
49
- --#{$component}-close: #{t.color($role)};
50
- --#{$component}-on-close: #{t.color('on-#{$role}')};
51
- --#{$component}-item: #{t.color('#{$role}-container')};
52
- --#{$component}-on-item: #{t.color('on-#{$role}-container')};
53
- }
54
- }
55
-
56
- // Placed: 16dp from the window edges, 24dp in large windows
57
- &--bottom-end,
58
- &--bottom-start {
59
- --#{$component}-margin: 16px;
60
- position: absolute;
61
- bottom: var(--#{$component}-margin);
62
- z-index: f.get-z-index('fixed');
63
-
64
- @media (min-width: 1200px) {
65
- --#{$component}-margin: 24px;
66
- }
67
- }
68
-
69
- &--bottom-end {
70
- @include d.end(var(--#{$component}-margin), $self: true);
71
- }
72
-
73
- &--bottom-start {
74
- @include d.start(var(--#{$component}-margin), $self: true);
75
-
76
- // Into the page from this edge. The shared rules stay on the inline end,
77
- // which is where bottom-end and an unplaced menu already open.
78
- .#{$fab}.#{$component}__fab {
79
- @include d.sides(0, auto);
80
- }
81
-
82
- .#{$component}__list {
83
- @include d.sides(0, auto);
84
- align-items: flex-start;
85
- }
86
-
87
- .#{$component}__item {
88
- justify-content: flex-start;
89
- }
90
- }
91
-
92
- // The FAB, pinned to the top trailing corner it shrinks towards. Doubled
93
- // with the FAB's own class, whose position: relative it overrides.
94
- @at-root .#{$fab}.#{$component}__fab {
95
- position: absolute;
96
- inset-block-start: 0;
97
- @include d.end(0);
98
- display: grid;
99
- place-items: center;
100
- transition:
101
- width $spatial,
102
- height $spatial,
103
- border-radius $spatial,
104
- background-color $spatial-colour,
105
- color $spatial-colour,
106
- box-shadow $spatial;
107
-
108
-
109
- > * {
110
- grid-area: 1 / 1;
111
- }
112
-
113
- .#{$fab}__icon,
114
- .#{$component}__close {
115
- transition: visibility 0s linear $swap;
116
- }
117
- }
118
-
119
- &__close {
120
- display: inline-flex;
121
- width: 20px;
122
- height: 20px;
123
- visibility: hidden;
124
-
125
- svg {
126
- width: 20px;
127
- height: 20px;
128
- fill: currentColor;
129
- }
130
- }
131
-
132
- // Open as a list: the close button
133
- &--list.#{$component}--open .#{$component}__fab {
134
- width: 56px;
135
- height: 56px;
136
- // Half the close button, not the full-shape token: the corner lerps from
137
- // the FAB's 16/20/28dp to 28dp (Compose FabFinalCornerRadius). Towards
138
- // 9999px it went round in one frame, and the spring's undershoot on
139
- // closing took it below 0, a square corner.
140
- border-radius: 28px;
141
- background-color: var(--#{$component}-close);
142
- color: var(--#{$component}-on-close);
143
-
144
- .#{$fab}__icon {
145
- visibility: hidden;
146
- }
147
-
148
- .#{$component}__close {
149
- visibility: visible;
150
- }
151
- }
152
-
153
- // The list: above the close button, end-aligned, scrolling behind it when
154
- // the window is short
155
- &__list {
156
- position: absolute;
157
- bottom: calc(100% + 8px);
158
- @include d.end(0);
159
- display: flex;
160
- flex-direction: column;
161
- align-items: flex-end;
162
- gap: 4px;
163
- overflow-y: auto;
164
- visibility: hidden;
165
- // Hidden once the last item has left
166
- transition: visibility 0s linear var(--#{$component}-exit, 0ms);
167
-
168
- }
169
-
170
- // The placement class and the direction marker are the same element here:
171
- // the runtime writes mtrl-rtl on this root, and dir="rtl" may sit on it. The
172
- // arms above need a strict ancestor; a root-carried [dir] does reach the
173
- // inner parts through the at-root attribute arm, but that arm sets the
174
- // left-to-right edges, so this root-carried form is written after it
175
- // (abstract/_direction.scss: nothing in the logical form, where the edges
176
- // mirror natively).
177
- &--bottom-start {
178
- @include d.arms-self-only {
179
- .#{$fab}.#{$component}__fab {
180
- right: 0;
181
- left: auto;
182
- }
183
-
184
- .#{$component}__list {
185
- right: 0;
186
- left: auto;
187
- }
188
- }
189
- }
190
-
191
- &--menu .#{$component}__list {
192
- display: none;
193
- }
194
-
195
- &--open .#{$component}__list {
196
- visibility: visible;
197
- transition-delay: 0s;
198
- }
199
-
200
- // An item: a pill, 56dp high, revealed by its width from 0 to its
201
- // content's, measured as the list opens (Compose animates the Row's width
202
- // inside a CornerFull surface). The width moves on FastSpatial, overshoot
203
- // included, and the item fades in on FastEffects, after its stagger delay.
204
- &__item {
205
- position: relative;
206
- display: inline-flex;
207
- flex-shrink: 0;
208
- justify-content: flex-end;
209
- box-sizing: border-box;
210
- width: 0;
211
- height: 56px;
212
- padding: 0;
213
- border: none;
214
- border-radius: v.shape('full');
215
- background-color: var(--#{$component}-item);
216
- color: var(--#{$component}-on-item);
217
- @include m.typography('title-medium');
218
- white-space: nowrap;
219
- cursor: pointer;
220
- overflow: hidden;
221
- opacity: 0;
222
- transition:
223
- opacity $effects,
224
- width $spatial;
225
- transition-delay: var(--#{$component}-delay, 0ms);
226
-
227
- &:hover {
228
- @include m.state-layer(currentColor, 'hover');
229
- }
230
-
231
- &:focus-visible {
232
- @include m.state-layer(currentColor, 'focus');
233
- outline: 2px solid t.color('secondary');
234
- outline-offset: 2px;
235
- }
236
-
237
- &:active {
238
- @include m.state-layer(currentColor, 'pressed');
239
- }
240
- }
241
-
242
- // The content keeps its natural width, anchored to the end: while the item
243
- // is narrower, the start of the label is clipped, as in Compose
244
- &__item-content {
245
- display: inline-flex;
246
- flex-shrink: 0;
247
- align-items: center;
248
- justify-content: center;
249
- gap: 8px;
250
- box-sizing: border-box;
251
- min-width: 56px;
252
- height: 100%;
253
- padding: 0 24px;
254
- }
255
-
256
- &--open .#{$component}__item {
257
- opacity: 1;
258
- width: var(--#{$component}-item-width, auto);
259
- }
260
-
261
- &__item-icon {
262
- display: inline-flex;
263
- width: 24px;
264
- height: 24px;
265
-
266
- svg {
267
- width: 24px;
268
- height: 24px;
269
- fill: currentColor;
270
- }
271
- }
272
-
273
- // Reduced motion: no stagger and no movement, a fade only
274
- @include m.reduced-motion {
275
- @at-root .#{$fab}.#{$component}__fab {
276
- transition: background-color $effects, color $effects;
277
- }
278
-
279
- &__item {
280
- transition: opacity $effects;
281
- }
282
- }
16
+ position: relative;
17
+ display: inline-block;
18
+ width: 56px;
19
+ height: 56px;
20
+ vertical-align: middle;
21
+
22
+ &--medium {
23
+ width: 80px;
24
+ height: 80px;
25
+ }
26
+
27
+ &--large {
28
+ width: 96px;
29
+ height: 96px;
30
+ }
31
+
32
+ @each $role in primary, secondary, tertiary {
33
+ &--#{$role} {
34
+ --#{$component}-close: #{t.color($role)};
35
+ --#{$component}-on-close: #{t.color('on-#{$role}')};
36
+ --#{$component}-item: #{t.color('#{$role}-container')};
37
+ --#{$component}-on-item: #{t.color('on-#{$role}-container')};
38
+ }
39
+ }
40
+
41
+ &--bottom-end,
42
+ &--bottom-start {
43
+ --#{$component}-margin: 16px;
44
+ position: absolute;
45
+ bottom: var(--#{$component}-margin);
46
+ z-index: f.get-z-index('fixed');
47
+
48
+ @media (min-width: 1200px) {
49
+ --#{$component}-margin: 24px;
50
+ }
51
+ }
52
+
53
+ &--bottom-end {
54
+ @include d.end(var(--#{$component}-margin), $self: true);
55
+ }
56
+
57
+ &--bottom-start {
58
+ @include d.start(var(--#{$component}-margin), $self: true);
59
+
60
+ .#{$fab}.#{$component}__fab {
61
+ @include d.sides(0, auto);
62
+ }
63
+
64
+ .#{$component}__list {
65
+ @include d.sides(0, auto);
66
+ align-items: flex-start;
67
+ }
68
+
69
+ .#{$component}__item {
70
+ justify-content: flex-start;
71
+ }
72
+ }
73
+
74
+ @at-root .#{$fab}.#{$component}__fab {
75
+ position: absolute;
76
+ inset-block-start: 0;
77
+ @include d.end(0);
78
+ display: grid;
79
+ place-items: center;
80
+ transition:
81
+ width $spatial,
82
+ height $spatial,
83
+ border-radius $spatial,
84
+ background-color $spatial-colour,
85
+ color $spatial-colour,
86
+ box-shadow $spatial;
87
+
88
+
89
+ > * {
90
+ grid-area: 1 / 1;
91
+ }
92
+
93
+ .#{$fab}__icon,
94
+ .#{$component}__close {
95
+ transition: visibility 0s linear $swap;
96
+ }
97
+ }
98
+
99
+ &__close {
100
+ display: inline-flex;
101
+ width: 20px;
102
+ height: 20px;
103
+ visibility: hidden;
104
+
105
+ svg {
106
+ width: 20px;
107
+ height: 20px;
108
+ fill: currentColor;
109
+ }
110
+ }
111
+
112
+ &--list.#{$component}--open .#{$component}__fab {
113
+ width: 56px;
114
+ height: 56px;
115
+ border-radius: 28px;
116
+ background-color: var(--#{$component}-close);
117
+ color: var(--#{$component}-on-close);
118
+
119
+ .#{$fab}__icon {
120
+ visibility: hidden;
121
+ }
122
+
123
+ .#{$component}__close {
124
+ visibility: visible;
125
+ }
126
+ }
127
+
128
+ &__list {
129
+ position: absolute;
130
+ bottom: calc(100% + 8px);
131
+ @include d.end(0);
132
+ display: flex;
133
+ flex-direction: column;
134
+ align-items: flex-end;
135
+ gap: 4px;
136
+ overflow-y: auto;
137
+ visibility: hidden;
138
+ transition: visibility 0s linear var(--#{$component}-exit, 0ms);
139
+
140
+ }
141
+
142
+ &--bottom-start {
143
+ @include d.arms-self-only {
144
+ .#{$fab}.#{$component}__fab {
145
+ right: 0;
146
+ left: auto;
147
+ }
148
+
149
+ .#{$component}__list {
150
+ right: 0;
151
+ left: auto;
152
+ }
153
+ }
154
+ }
155
+
156
+ &--menu .#{$component}__list {
157
+ display: none;
158
+ }
159
+
160
+ &--open .#{$component}__list {
161
+ visibility: visible;
162
+ transition-delay: 0s;
163
+ }
164
+
165
+ &__item {
166
+ position: relative;
167
+ display: inline-flex;
168
+ flex-shrink: 0;
169
+ justify-content: flex-end;
170
+ box-sizing: border-box;
171
+ width: 0;
172
+ height: 56px;
173
+ padding: 0;
174
+ border: none;
175
+ border-radius: v.shape('full');
176
+ background-color: var(--#{$component}-item);
177
+ color: var(--#{$component}-on-item);
178
+ @include m.typography('title-medium');
179
+ white-space: nowrap;
180
+ cursor: pointer;
181
+ overflow: hidden;
182
+ opacity: 0;
183
+ transition:
184
+ opacity $effects,
185
+ width $spatial;
186
+ transition-delay: var(--#{$component}-delay, 0ms);
187
+
188
+ &:hover {
189
+ @include m.state-layer(currentColor, 'hover');
190
+ }
191
+
192
+ &:focus-visible {
193
+ @include m.state-layer(currentColor, 'focus');
194
+ outline: 2px solid t.color('secondary');
195
+ outline-offset: 2px;
196
+ }
197
+
198
+ &:active {
199
+ @include m.state-layer(currentColor, 'pressed');
200
+ }
201
+ }
202
+
203
+ &__item-content {
204
+ display: inline-flex;
205
+ flex-shrink: 0;
206
+ align-items: center;
207
+ justify-content: center;
208
+ gap: 8px;
209
+ box-sizing: border-box;
210
+ min-width: 56px;
211
+ height: 100%;
212
+ padding: 0 24px;
213
+ }
214
+
215
+ &--open .#{$component}__item {
216
+ opacity: 1;
217
+ width: var(--#{$component}-item-width, auto);
218
+ }
219
+
220
+ &__item-icon {
221
+ display: inline-flex;
222
+ width: 24px;
223
+ height: 24px;
224
+
225
+ svg {
226
+ width: 24px;
227
+ height: 24px;
228
+ fill: currentColor;
229
+ }
230
+ }
231
+
232
+ @include m.reduced-motion {
233
+ @at-root .#{$fab}.#{$component}__fab {
234
+ transition: background-color $effects, color $effects;
235
+ }
236
+
237
+ &__item {
238
+ transition: opacity $effects;
239
+ }
240
+ }
283
241
  }