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,22 +1,3 @@
1
- // src/styles/components/_split-button.scss
2
- //
3
- // Split button, after the Material 3 tokens (Compose SplitButtonXSmallTokens
4
- // through SplitButtonXLargeTokens): a leading button carrying an action and a
5
- // trailing button that opens more choices, 2dp apart, the pair reading as one
6
- // pill. The outer corners are full and the inner ones are small, growing when
7
- // the button is hovered or pressed; the trailing button's inner corner
8
- // becomes a circle while its menu is open, and its chevron turns 180 degrees.
9
- //
10
- // Both halves are the library's own button, so their colours, state layers,
11
- // focus rings and touch targets come from there.
12
- //
13
- // The corners are written as the logical properties and go through the
14
- // direction switch (abstract/_direction.scss): the runtime-adopted sheets
15
- // keep the logical radii, and the artefacts a consumer bundler lowers carry
16
- // the physical pair with the right-to-left pair as a direction arm, so the
17
- // bundler's :lang() lowering cannot pin them to the left-to-left corners of a
18
- // right-to-left page. The radii themselves are custom properties, so a state
19
- // changes only their value and the arms keep choosing the pair.
20
1
  @use "sass:map";
21
2
  @use "sass:math";
22
3
  @use "../../styles/abstract/base" as base;
@@ -29,239 +10,169 @@
29
10
  $component: "#{base.$prefix}-split-button";
30
11
  $button: "#{base.$prefix}-button";
31
12
 
32
- // height, leading start/end space, trailing space, icon, inner corner,
33
- // inner corner when hovered or pressed, and how far the chevron sits from
34
- // the centre while the menu is closed.
35
- //
36
- // The resting inner corner keeps the token value at the two small sizes,
37
- // where the spec's own renders show it at about an eighth of the height, and
38
- // holds that proportion at the three larger ones instead of the token's
39
- // 4, 8 and 12dp. Those read as square corners beside a full pill: a 4dp
40
- // corner is a fourteenth of a 56dp button. Set
41
- // `--<prefix>-split-button-inner-shape` to go back to the token value.
42
13
  $sizes: (
43
- "xs": (height: 32px, lead-start: 12px, lead-end: 10px, trail: 13px, icon: 22px, inner: v.shape("extra-small"), inner-active: v.shape("small"), offset: 1px),
44
- "s": (height: 40px, lead-start: 16px, lead-end: 12px, trail: 13px, icon: 22px, inner: v.shape("extra-small"), inner-active: v.shape("medium"), offset: 1px),
45
- "m": (height: 56px, lead-start: 24px, lead-end: 24px, trail: 15px, icon: 26px, inner: v.shape("small"), inner-active: v.shape("medium"), offset: 2px),
46
- "l": (height: 96px, lead-start: 48px, lead-end: 48px, trail: 29px, icon: 38px, inner: v.shape("medium"), inner-active: v.shape("large-increased"), offset: 3px),
47
- "xl": (height: 136px, lead-start: 64px, lead-end: 64px, trail: 43px, icon: 50px, inner: v.shape("large"), inner-active: v.shape("large-increased"), offset: 6px)
14
+ "xs": (height: 32px, lead-start: 12px, lead-end: 10px, trail: 13px, icon: 22px, inner: v.shape("extra-small"), inner-active: v.shape("small"), offset: 1px),
15
+ "s": (height: 40px, lead-start: 16px, lead-end: 12px, trail: 13px, icon: 22px, inner: v.shape("extra-small"), inner-active: v.shape("medium"), offset: 1px),
16
+ "m": (height: 56px, lead-start: 24px, lead-end: 24px, trail: 15px, icon: 26px, inner: v.shape("small"), inner-active: v.shape("medium"), offset: 2px),
17
+ "l": (height: 96px, lead-start: 48px, lead-end: 48px, trail: 29px, icon: 38px, inner: v.shape("medium"), inner-active: v.shape("large-increased"), offset: 3px),
18
+ "xl": (height: 136px, lead-start: 64px, lead-end: 64px, trail: 43px, icon: 50px, inner: v.shape("large"), inner-active: v.shape("large-increased"), offset: 6px)
48
19
  );
49
20
 
50
- // The space between the two halves, at every size (BetweenSpace)
51
21
  $gap: 2px;
52
22
 
53
23
  .#{$component} {
54
- display: inline-flex;
55
- align-items: stretch;
56
- gap: $gap;
57
- vertical-align: middle;
58
-
59
- // The two halves keep their own shapes; nothing here fights the button's
60
- // own colours or states.
61
- //
62
- // The outer corners are half the height rather than a large pill value.
63
- // CSS scales every corner of a box down together when the radii along any
64
- // side overflow it, so a 9999px pill beside a 4dp corner drags that corner
65
- // to about a fiftieth of a pixel and the split reads as a square cut.
66
- // Half the height is the same pill and leaves the inner corner alone.
67
- //
68
- // The size classes set the three radii; a root without one keeps the
69
- // default size's values, which is the size the factory defaults to.
70
- --#{$component}-pill: #{math.div(map.get($sizes, "s", "height"), 2)};
71
- --#{$component}-corner: var(--#{$component}-inner-shape, #{map.get($sizes, "s", "inner")});
72
- --#{$component}-corner-active: var(--#{$component}-inner-shape-active, #{map.get($sizes, "s", "inner-active")});
73
-
74
- .#{$button} {
75
- transition:
76
- border-radius v.motion("spring-fast-spatial-duration") v.motion("spring-fast-spatial-easing"),
77
- background-color v.motion("duration-short2") v.motion("easing-standard");
78
- }
79
-
80
- // ---------------------------------------------------------------------------
81
- // Sizes
82
- // ---------------------------------------------------------------------------
83
- @each $size, $spec in $sizes {
84
- &--#{$size} {
85
- --#{$component}-pill: #{math.div(map.get($spec, "height"), 2)};
86
- --#{$component}-corner: var(--#{$component}-inner-shape, #{map.get($spec, "inner")});
87
- --#{$component}-corner-active: var(--#{$component}-inner-shape-active, #{map.get($spec, "inner-active")});
24
+ display: inline-flex;
25
+ align-items: stretch;
26
+ gap: $gap;
27
+ vertical-align: middle;
28
+
29
+ --#{$component}-pill: #{math.div(map.get($sizes, "s", "height"), 2)};
30
+ --#{$component}-corner: var(--#{$component}-inner-shape, #{map.get($sizes, "s", "inner")});
31
+ --#{$component}-corner-active: var(--#{$component}-inner-shape-active, #{map.get($sizes, "s", "inner-active")});
32
+
33
+ .#{$button} {
34
+ transition:
35
+ border-radius v.motion("spring-fast-spatial-duration") v.motion("spring-fast-spatial-easing"),
36
+ background-color v.motion("duration-short2") v.motion("easing-standard");
37
+ }
88
38
 
89
- .#{$button} {
90
- height: map.get($spec, "height");
91
- min-height: map.get($spec, "height");
92
- }
39
+ @each $size, $spec in $sizes {
40
+ &--#{$size} {
41
+ --#{$component}-pill: #{math.div(map.get($spec, "height"), 2)};
42
+ --#{$component}-corner: var(--#{$component}-inner-shape, #{map.get($spec, "inner")});
43
+ --#{$component}-corner-active: var(--#{$component}-inner-shape-active, #{map.get($spec, "inner-active")});
93
44
 
94
- // The leading button: an outer pill edge, an inner corner facing its
95
- // neighbour
96
- .#{$component}__leading {
97
- padding-inline: map.get($spec, "lead-start") map.get($spec, "lead-end");
98
- // Compose SplitButtonDefaults.LeadingButtonMinWidth
99
- min-width: 48px;
100
- }
45
+ .#{$button} {
46
+ height: map.get($spec, "height");
47
+ min-height: map.get($spec, "height");
48
+ }
101
49
 
102
- // The trailing button is symmetrical, so its icon is nudged towards the
103
- // flat edge to sit optically centred; while the menu is open the corner
104
- // is round and the icon centres properly
105
- .#{$component}__trailing {
106
- padding-inline: map.get($spec, "trail");
107
- // Its width is its padding and its icon, not the button's own minimum
108
- min-width: 0;
50
+ .#{$component}__leading {
51
+ padding-inline: map.get($spec, "lead-start") map.get($spec, "lead-end");
52
+ min-width: 48px;
53
+ }
109
54
 
110
- // The icon sits in the button's icon wrapper, which has a size of its
111
- // own; the split button's chevron is bigger than a button icon
112
- .#{$button}__icon {
113
- width: map.get($spec, "icon");
114
- height: map.get($spec, "icon");
115
- }
55
+ .#{$component}__trailing {
56
+ padding-inline: map.get($spec, "trail");
57
+ min-width: 0;
116
58
 
117
- .#{$component}__chevron {
118
- width: map.get($spec, "icon");
119
- height: map.get($spec, "icon");
120
- translate: calc(-1 * #{map.get($spec, "offset")}) 0;
121
- }
59
+ .#{$button}__icon {
60
+ width: map.get($spec, "icon");
61
+ height: map.get($spec, "icon");
62
+ }
122
63
 
123
- @include m.rtl {
124
- .#{$component}__chevron {
125
- translate: map.get($spec, "offset") 0;
126
- }
127
- }
128
- }
129
- }
130
- }
64
+ .#{$component}__chevron {
65
+ width: map.get($spec, "icon");
66
+ height: map.get($spec, "icon");
67
+ translate: calc(-1 * #{map.get($spec, "offset")}) 0;
68
+ }
131
69
 
132
- // ---------------------------------------------------------------------------
133
- // The corners: the outer pair faces out, the inner pair faces the gap. The
134
- // leading half's inner corners sit on its trailing edge and the trailing
135
- // half's on its leading edge, so the right-to-left form swaps the pair.
136
- // ---------------------------------------------------------------------------
137
- .#{$button} {
138
- border-radius: var(--#{$component}-pill);
139
- }
70
+ @include m.rtl {
71
+ .#{$component}__chevron {
72
+ translate: map.get($spec, "offset") 0;
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
140
78
 
141
- .#{$component}__leading {
142
- @include d.corners(
143
- $start-start: var(--#{$component}-pill),
144
- $start-end: var(--#{$component}-corner),
145
- $end-start: var(--#{$component}-pill),
146
- $end-end: var(--#{$component}-corner),
147
- );
148
- }
79
+ .#{$button} {
80
+ border-radius: var(--#{$component}-pill);
81
+ }
149
82
 
150
- .#{$component}__trailing {
151
- @include d.corners(
152
- $start-start: var(--#{$component}-corner),
153
- $start-end: var(--#{$component}-pill),
154
- $end-start: var(--#{$component}-corner),
155
- $end-end: var(--#{$component}-pill),
156
- );
157
- }
83
+ .#{$component}__leading {
84
+ @include d.corners(
85
+ $start-start: var(--#{$component}-pill),
86
+ $start-end: var(--#{$component}-corner),
87
+ $end-start: var(--#{$component}-pill),
88
+ $end-end: var(--#{$component}-corner),
89
+ );
90
+ }
158
91
 
159
- // The inner corner grows further while a half is hovered, focused or
160
- // pressed. Only the value changes, so the arms keep choosing the pair.
161
- .#{$component}__leading:where(:hover, :focus-visible, :active),
162
- .#{$component}__trailing:where(:hover, :focus-visible, :active) {
163
- --#{$component}-corner: var(--#{$component}-corner-active);
164
- }
92
+ .#{$component}__trailing {
93
+ @include d.corners(
94
+ $start-start: var(--#{$component}-corner),
95
+ $start-end: var(--#{$component}-pill),
96
+ $end-start: var(--#{$component}-corner),
97
+ $end-end: var(--#{$component}-pill),
98
+ );
99
+ }
165
100
 
166
- // Open: the trailing button's inner corner rounds off into a circle. The
167
- // pill is the same on either side, so this needs no arm.
168
- &--expanded .#{$component}__trailing {
169
- --#{$component}-corner: var(--#{$component}-pill);
170
- }
101
+ .#{$component}__leading:where(:hover, :focus-visible, :active),
102
+ .#{$component}__trailing:where(:hover, :focus-visible, :active) {
103
+ --#{$component}-corner: var(--#{$component}-corner-active);
104
+ }
171
105
 
172
- // The placement class and the direction marker are the same element here:
173
- // the runtime writes mtrl-rtl on this root, and dir="rtl" may sit on it.
174
- // The arms above need a strict ancestor, so the root-carried form is
175
- // written here, after them (abstract/_direction.scss: nothing in the
176
- // logical form, where the radii mirror natively).
177
- @include d.arms-self-only {
178
- .#{$component}__leading {
179
- border-radius: var(--#{$component}-corner) var(--#{$component}-pill) var(--#{$component}-pill) var(--#{$component}-corner);
180
- }
106
+ &--expanded .#{$component}__trailing {
107
+ --#{$component}-corner: var(--#{$component}-pill);
108
+ }
181
109
 
182
- .#{$component}__trailing {
183
- border-radius: var(--#{$component}-pill) var(--#{$component}-corner) var(--#{$component}-corner) var(--#{$component}-pill);
184
- }
185
- }
110
+ @include d.arms-self-only {
111
+ .#{$component}__leading {
112
+ border-radius: var(--#{$component}-corner) var(--#{$component}-pill) var(--#{$component}-pill) var(--#{$component}-corner);
113
+ }
186
114
 
187
- // ---------------------------------------------------------------------------
188
- // The halves stay flat. A standalone filled or tonal button rises to level 1
189
- // on hover (ButtonDefaults.buttonElevation), but here that shadow falls
190
- // across the 2dp gap and onto the other half, and the pair stops reading as
191
- // one control: whichever half the pointer is over appears to float above its
192
- // neighbour. The split button's own states are state layers and the inner
193
- // corner morph (m3.material.io split button specs, "States"), which is what
194
- // is left. A connected button group flattens its segments for the same
195
- // reason. An elevated split button keeps its elevation: that is what the
196
- // variant is.
197
- // ---------------------------------------------------------------------------
198
- &--filled,
199
- &--tonal {
200
- .#{$button} {
201
- &,
202
- &:hover,
203
- &:focus-visible,
204
- &:active {
205
- box-shadow: none;
206
- }
207
- }
208
- }
115
+ .#{$component}__trailing {
116
+ border-radius: var(--#{$component}-pill) var(--#{$component}-corner) var(--#{$component}-corner) var(--#{$component}-pill);
117
+ }
118
+ }
209
119
 
210
- // ---------------------------------------------------------------------------
211
- // Open: the inner corner rounds off and the chevron turns over
212
- // ---------------------------------------------------------------------------
213
- &--expanded {
214
- .#{$component}__trailing {
215
- .#{$component}__chevron {
216
- translate: 0 0;
217
- rotate: 180deg;
218
- }
219
- }
220
- }
120
+ &--filled,
121
+ &--tonal {
122
+ .#{$button} {
123
+ &,
124
+ &:hover,
125
+ &:focus-visible,
126
+ &:active {
127
+ box-shadow: none;
128
+ }
129
+ }
130
+ }
221
131
 
222
- // ---------------------------------------------------------------------------
223
- // The chevron: it turns on the standard motion scheme, not the expressive
224
- // one (M3 split button guidelines, "Behavior")
225
- // ---------------------------------------------------------------------------
226
- &__chevron {
227
- display: block;
228
- flex: none;
229
- transition:
230
- rotate v.motion("duration-medium1") v.motion("easing-standard"),
231
- translate v.motion("duration-medium1") v.motion("easing-standard");
232
- }
132
+ &--expanded {
133
+ .#{$component}__trailing {
134
+ .#{$component}__chevron {
135
+ translate: 0 0;
136
+ rotate: 180deg;
137
+ }
138
+ }
139
+ }
233
140
 
234
- // ---------------------------------------------------------------------------
235
- // Each half keeps a 48dp target even when the button is shorter
236
- // (M3 split button accessibility)
237
- // ---------------------------------------------------------------------------
238
- &--xs,
239
- &--s {
240
- .#{$button} {
241
- position: relative;
141
+ &__chevron {
142
+ display: block;
143
+ flex: none;
144
+ transition:
145
+ rotate v.motion("duration-medium1") v.motion("easing-standard"),
146
+ translate v.motion("duration-medium1") v.motion("easing-standard");
147
+ }
242
148
 
243
- &::after {
244
- content: "";
245
- position: absolute;
246
- inset-inline: 0;
247
- top: 50%;
248
- translate: 0 -50%;
249
- height: v.button("touch-target");
250
- min-height: 100%;
251
- }
252
- }
253
- }
149
+ &--xs,
150
+ &--s {
151
+ .#{$button} {
152
+ position: relative;
153
+
154
+ &::after {
155
+ content: "";
156
+ position: absolute;
157
+ inset-inline: 0;
158
+ top: 50%;
159
+ translate: 0 -50%;
160
+ height: v.button("touch-target");
161
+ min-height: 100%;
162
+ }
163
+ }
164
+ }
254
165
 
255
- @include m.reduced-motion {
256
- .#{$button},
257
- &__chevron {
258
- transition: none;
259
- }
260
- }
166
+ @include m.reduced-motion {
167
+ .#{$button},
168
+ &__chevron {
169
+ transition: none;
170
+ }
171
+ }
261
172
 
262
- @include m.print {
263
- .#{$component}__trailing {
264
- display: none;
265
- }
266
- }
173
+ @include m.print {
174
+ .#{$component}__trailing {
175
+ display: none;
176
+ }
177
+ }
267
178
  }