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,4 +1,3 @@
1
- // src/styles/components/_icon-button.scss
2
1
  @use "sass:map";
3
2
  @use "../../styles/abstract/base" as base;
4
3
  @use "../../styles/abstract/variables" as v;
@@ -8,604 +7,500 @@
8
7
 
9
8
  $component: "#{base.$prefix}-icon-button";
10
9
 
11
- // =============================================================================
12
- // ICON BUTTON COMPONENT STYLES
13
- // =============================================================================
14
- // Material Design 3 Icon Button implementation
15
- // Supports:
16
- // - Four variants (filled, tonal, outlined, standard)
17
- // - Five sizes (xs, s, m, l, xl)
18
- // - Two shapes (round, square)
19
- // - Three widths (narrow, default, wide)
20
- // - Toggle mode with selected/unselected states
21
- // - Shape morphing on press and selection
22
- // - State layers and ripple effects
23
- // - Full accessibility support
24
- // =============================================================================
25
-
26
- // -----------------------------------------------------------------------------
27
- // Size configuration maps
28
- // -----------------------------------------------------------------------------
10
+
29
11
  $sizes: (
30
- "xs": (
31
- container: 32px,
32
- // Round shape: exactly half the container height. See the base shape.
33
- round-radius: 16px,
34
- icon: 20px,
35
- square-radius: v.shape('medium'),
36
- pressed-radius: v.shape('small'),
37
- outline-width: 1px,
38
- ),
39
- "s": (
40
- container: 40px,
41
- // Round shape: exactly half the container height. See the base shape.
42
- round-radius: 20px,
43
- icon: 24px,
44
- square-radius: v.shape('medium'),
45
- pressed-radius: v.shape('small'),
46
- outline-width: 1px,
47
- ),
48
- "m": (
49
- container: 56px,
50
- // Round shape: exactly half the container height. See the base shape.
51
- round-radius: 28px,
52
- icon: 24px,
53
- square-radius: v.shape('large'),
54
- pressed-radius: v.shape('medium'),
55
- outline-width: 1px,
56
- ),
57
- "l": (
58
- container: 96px,
59
- // Round shape: exactly half the container height. See the base shape.
60
- round-radius: 48px,
61
- icon: 32px,
62
- square-radius: v.shape('extra-large'),
63
- pressed-radius: v.shape('large'),
64
- outline-width: 2px,
65
- ),
66
- "xl": (
67
- container: 136px,
68
- // Round shape: exactly half the container height. See the base shape.
69
- round-radius: 68px,
70
- icon: 40px,
71
- square-radius: v.shape('extra-large'),
72
- pressed-radius: v.shape('large'),
73
- outline-width: 3px,
74
- ),
12
+ "xs": (
13
+ container: 32px,
14
+ round-radius: 16px,
15
+ icon: 20px,
16
+ square-radius: v.shape('medium'),
17
+ pressed-radius: v.shape('small'),
18
+ outline-width: 1px,
19
+ ),
20
+ "s": (
21
+ container: 40px,
22
+ round-radius: 20px,
23
+ icon: 24px,
24
+ square-radius: v.shape('medium'),
25
+ pressed-radius: v.shape('small'),
26
+ outline-width: 1px,
27
+ ),
28
+ "m": (
29
+ container: 56px,
30
+ round-radius: 28px,
31
+ icon: 24px,
32
+ square-radius: v.shape('large'),
33
+ pressed-radius: v.shape('medium'),
34
+ outline-width: 1px,
35
+ ),
36
+ "l": (
37
+ container: 96px,
38
+ round-radius: 48px,
39
+ icon: 32px,
40
+ square-radius: v.shape('extra-large'),
41
+ pressed-radius: v.shape('large'),
42
+ outline-width: 2px,
43
+ ),
44
+ "xl": (
45
+ container: 136px,
46
+ round-radius: 68px,
47
+ icon: 40px,
48
+ square-radius: v.shape('extra-large'),
49
+ pressed-radius: v.shape('large'),
50
+ outline-width: 3px,
51
+ ),
75
52
  );
76
53
 
77
54
  $widths: (
78
- "xs": (
79
- narrow: 28px,
80
- default: 32px,
81
- wide: 40px,
82
- ),
83
- "s": (
84
- narrow: 32px,
85
- default: 40px,
86
- wide: 52px,
87
- ),
88
- "m": (
89
- narrow: 48px,
90
- default: 56px,
91
- wide: 72px,
92
- ),
93
- "l": (
94
- narrow: 64px,
95
- default: 96px,
96
- wide: 128px,
97
- ),
98
- "xl": (
99
- narrow: 104px,
100
- default: 136px,
101
- wide: 184px,
102
- ),
55
+ "xs": (
56
+ narrow: 28px,
57
+ default: 32px,
58
+ wide: 40px,
59
+ ),
60
+ "s": (
61
+ narrow: 32px,
62
+ default: 40px,
63
+ wide: 52px,
64
+ ),
65
+ "m": (
66
+ narrow: 48px,
67
+ default: 56px,
68
+ wide: 72px,
69
+ ),
70
+ "l": (
71
+ narrow: 64px,
72
+ default: 96px,
73
+ wide: 128px,
74
+ ),
75
+ "xl": (
76
+ narrow: 104px,
77
+ default: 136px,
78
+ wide: 184px,
79
+ ),
103
80
  );
104
81
 
105
- // Helper function to get size values
106
82
  @function get-size($size, $property) {
107
- @return map.get(map.get($sizes, $size), $property);
83
+ @return map.get(map.get($sizes, $size), $property);
108
84
  }
109
85
 
110
86
  @function get-width($size, $width-variant) {
111
- @return map.get(map.get($widths, $size), $width-variant);
87
+ @return map.get(map.get($widths, $size), $width-variant);
112
88
  }
113
89
 
114
- // -----------------------------------------------------------------------------
115
- // Base styles
116
- // -----------------------------------------------------------------------------
117
90
  .#{$component} {
118
- // Reset and base styles
119
- position: relative;
120
- display: inline-flex;
121
- align-items: center;
122
- justify-content: center;
123
- border: none;
124
- // The page reset's `button{padding:0}` (styles/base/_reset.scss) does not
125
- // reach a shadow root, so the sheet the element adopts has to repeat it:
126
- // Chrome's user-agent padding (1px 6px) leaves the narrow containers no
127
- // room for the icon, a shrinkable flex item, and it is drawn under its
128
- // size token.
129
- padding: 0;
130
- background-color: transparent;
131
- color: t.color("on-surface-variant");
132
- font: inherit;
133
- text-decoration: none;
134
- cursor: pointer;
135
- user-select: none;
136
- vertical-align: middle;
137
- appearance: none;
138
- // Not clipped: the state layer and the ripple clip themselves to the
139
- // shape, and the 48dp target of the xs and s sizes must reach outside
140
- // the container to take a pointer
141
- overflow: visible;
142
- flex-shrink: 0;
143
-
144
- // Default size (s - 40px)
145
- width: get-size("s", container);
146
- height: get-size("s", container);
147
-
148
- // Default shape: round, with the real radius of half the container
149
- // height. A 9999px full shape paints the same at rest, but border-radius
150
- // animates on the number in the stylesheet, so a morph from 9999px to the
151
- // 8dp pressed shape stays above half the height for almost the whole
152
- // transition and then snaps square. Half the height interpolates, so the
153
- // press reads as a morph. On narrow widths the browser scales the radius
154
- // down to half the smaller side, as it did for 9999px.
155
- border-radius: var(--#{base.$prefix}-button-shape, get-size("s", round-radius));
156
-
157
- // Smooth transitions for shape morphing
158
- transition:
159
- background-color v.motion("duration-short2") v.motion("easing-standard"),
160
- color v.motion("duration-short2") v.motion("easing-standard"),
161
- border-color v.motion("duration-short2") v.motion("easing-standard"),
162
- border-radius v.motion("duration-short1")
163
- v.motion("easing-standard-accelerate"),
164
- transform v.motion("duration-short1")
165
- v.motion("easing-standard-accelerate"),
166
- box-shadow v.motion("duration-short2") v.motion("easing-standard");
167
-
168
- // Focus styles
169
- &:focus {
170
- outline: none;
171
- }
172
-
173
- &:focus-visible {
174
- outline: 2px solid t.color("outline");
175
- outline-offset: 2px;
176
- }
177
-
178
- // State layer
179
- &::before {
180
- content: "";
181
- position: absolute;
182
- top: 0;
183
- left: 0;
184
- right: 0;
185
- bottom: 0;
186
- background-color: currentColor;
187
- opacity: 0;
188
- pointer-events: none;
189
- border-radius: inherit;
190
- transition: opacity v.motion("duration-short2")
191
- v.motion("easing-standard");
192
- }
193
-
194
- // Hover state layer (8%)
195
- &:hover::before {
196
- opacity: 0.08;
197
- }
198
-
199
- // Focus state layer (10%)
200
- &:focus-visible::before {
201
- opacity: 0.1;
202
- }
203
-
204
- // Pressed state layer (10%), left to the ripple when there is one
205
- &:active:not(:has(> .#{base.$prefix}-ripple))::before {
206
- opacity: 0.1;
207
- }
208
-
209
- // ---------------------------------------------------------------------------
210
- // Icon element
211
- // ---------------------------------------------------------------------------
212
- &__icon,
213
- .#{base.$prefix}-icon,
214
- .#{$component}__icon {
215
- display: inline-flex;
216
- align-items: center;
217
- justify-content: center;
218
- width: get-size("s", icon);
219
- height: get-size("s", icon);
220
- pointer-events: none;
221
-
222
- svg {
223
- width: 100%;
224
- height: 100%;
225
- // fill: currentColor !important;
226
- }
227
- }
228
-
229
- // ---------------------------------------------------------------------------
230
- // Size variants
231
- // ---------------------------------------------------------------------------
232
- &--xs {
233
- width: get-size("xs", container);
234
- height: get-size("xs", container);
235
-
236
- .#{base.$prefix}-icon,
237
- .#{$component}__icon {
238
- width: get-size("xs", icon);
239
- height: get-size("xs", icon);
240
- }
241
- }
242
-
243
- // Keep a minimum 48px touch target for both smaller container sizes.
244
- &--xs::after,
245
- &--s::after {
246
- content: "";
247
- position: absolute;
248
- width: 48px;
249
- height: 48px;
250
- top: 50%;
251
- left: 50%;
252
- transform: translate(-50%, -50%);
253
- }
254
-
255
- &--m {
256
- width: get-size("m", container);
257
- height: get-size("m", container);
258
-
259
- .#{base.$prefix}-icon,
260
- .#{$component}__icon {
261
- width: get-size("m", icon);
262
- height: get-size("m", icon);
263
- }
264
- }
265
-
266
- &--l {
267
- width: get-size("l", container);
268
- height: get-size("l", container);
269
-
270
- .#{base.$prefix}-icon,
271
- .#{$component}__icon {
272
- width: get-size("l", icon);
273
- height: get-size("l", icon);
274
- }
275
- }
276
-
277
- &--xl {
278
- width: get-size("xl", container);
279
- height: get-size("xl", container);
280
-
281
- .#{base.$prefix}-icon,
282
- .#{$component}__icon {
283
- width: get-size("xl", icon);
284
- height: get-size("xl", icon);
285
- }
286
- }
287
-
288
- // ---------------------------------------------------------------------------
289
- // Shape variants
290
- // ---------------------------------------------------------------------------
291
-
292
- // Round is the default: half the container height per size
293
- &--round {
294
- border-radius: var(--#{base.$prefix}-button-shape, get-size("s", round-radius));
295
-
296
- &.#{$component}--xs {
297
- border-radius: var(--#{base.$prefix}-button-shape, get-size("xs", round-radius));
298
- }
299
-
300
- &.#{$component}--m {
301
- border-radius: var(--#{base.$prefix}-button-shape, get-size("m", round-radius));
302
- }
303
-
304
- &.#{$component}--l {
305
- border-radius: var(--#{base.$prefix}-button-shape, get-size("l", round-radius));
306
- }
307
-
308
- &.#{$component}--xl {
309
- border-radius: var(--#{base.$prefix}-button-shape, get-size("xl", round-radius));
310
- }
311
- }
312
-
313
- // Square shape with size-specific corner radius
314
- &--square {
315
- border-radius: var(--#{base.$prefix}-button-shape, get-size("s", square-radius));
316
-
317
- &.#{$component}--xs {
318
- border-radius: var(--#{base.$prefix}-button-shape, get-size("xs", square-radius));
319
- }
320
-
321
- &.#{$component}--m {
322
- border-radius: var(--#{base.$prefix}-button-shape, get-size("m", square-radius));
323
- }
324
-
325
- &.#{$component}--l {
326
- border-radius: var(--#{base.$prefix}-button-shape, get-size("l", square-radius));
327
- }
328
-
329
- &.#{$component}--xl {
330
- border-radius: var(--#{base.$prefix}-button-shape, get-size("xl", square-radius));
331
- }
332
- }
333
-
334
- // Shape morph on press - both round and square morph to pressed radius.
335
- // A container can keep the resting shape instead (a toolbar does: see
336
- // the toolbar rule in _toolbar.scss) through the icon button's own
337
- // override, which an explicit --…-button-shape-pressed still beats.
338
- &:active {
339
- &.#{$component}--round {
340
- border-radius: var(
341
- --#{base.$prefix}-button-shape-pressed,
342
- var(--#{base.$prefix}-icon-button-shape-pressed, get-size("s", pressed-radius))
343
- );
344
-
345
- &.#{$component}--xs {
346
- border-radius: var(
347
- --#{base.$prefix}-button-shape-pressed,
348
- var(--#{base.$prefix}-icon-button-shape-pressed, get-size("xs", pressed-radius))
349
- );
350
- }
351
-
352
- &.#{$component}--m {
353
- border-radius: var(
354
- --#{base.$prefix}-button-shape-pressed,
355
- var(--#{base.$prefix}-icon-button-shape-pressed, get-size("m", pressed-radius))
356
- );
357
- }
358
-
359
- &.#{$component}--l {
360
- border-radius: var(
361
- --#{base.$prefix}-button-shape-pressed,
362
- var(--#{base.$prefix}-icon-button-shape-pressed, get-size("l", pressed-radius))
363
- );
364
- }
365
-
366
- &.#{$component}--xl {
367
- border-radius: var(
368
- --#{base.$prefix}-button-shape-pressed,
369
- var(--#{base.$prefix}-icon-button-shape-pressed, get-size("xl", pressed-radius))
370
- );
371
- }
372
- }
373
-
374
- &.#{$component}--square {
375
- border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("s", pressed-radius));
376
-
377
- &.#{$component}--xs {
378
- border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xs", pressed-radius));
379
- }
380
-
381
- &.#{$component}--m {
382
- border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("m", pressed-radius));
383
- }
384
-
385
- &.#{$component}--l {
386
- border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("l", pressed-radius));
387
- }
388
-
389
- &.#{$component}--xl {
390
- border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xl", pressed-radius));
391
- }
392
- }
393
- }
394
-
395
- // ---------------------------------------------------------------------------
396
- // Width variants
397
- // ---------------------------------------------------------------------------
398
- &--narrow {
399
- width: get-width("s", narrow);
400
-
401
- &.#{$component}--xs {
402
- width: get-width("xs", narrow);
403
- }
404
-
405
- &.#{$component}--m {
406
- width: get-width("m", narrow);
407
- }
408
-
409
- &.#{$component}--l {
410
- width: get-width("l", narrow);
411
- }
412
-
413
- &.#{$component}--xl {
414
- width: get-width("xl", narrow);
415
- }
416
- }
417
-
418
- &--wide {
419
- width: get-width("s", wide);
420
-
421
- &.#{$component}--xs {
422
- width: get-width("xs", wide);
423
- }
424
-
425
- &.#{$component}--m {
426
- width: get-width("m", wide);
427
- }
428
-
429
- &.#{$component}--l {
430
- width: get-width("l", wide);
431
- }
432
-
433
- &.#{$component}--xl {
434
- width: get-width("xl", wide);
435
- }
436
- }
437
-
438
- // ---------------------------------------------------------------------------
439
- // Variant: Standard (default)
440
- // ---------------------------------------------------------------------------
441
- // The standard colour and the selected toggle's colours read custom
442
- // properties a container sets, which reach into an element's shadow root:
443
- // the vibrant toolbar's items (FloatingToolbarTokens Vibrant*).
444
- &--standard {
445
- background-color: transparent;
446
- color: var(--#{base.$prefix}-icon-button-standard-color, #{t.color("on-surface-variant")});
447
-
448
- // Toggle selected state
449
- &.#{$component}--selected {
450
- background-color: var(--#{base.$prefix}-icon-button-selected-container, transparent);
451
- color: var(--#{base.$prefix}-icon-button-selected-color, #{t.color("primary")});
452
- }
453
- }
454
-
455
- // ---------------------------------------------------------------------------
456
- // Variant: Filled
457
- // ---------------------------------------------------------------------------
458
- &--filled {
459
- background-color: t.color("primary");
460
- color: t.color("on-primary");
461
-
462
- // Toggle unselected state
463
- &.#{$component}--toggle:not(.#{$component}--selected) {
464
- background-color: t.color("surface-container");
465
- color: t.color("on-surface-variant");
466
- }
467
- }
468
-
469
- // ---------------------------------------------------------------------------
470
- // Variant: Tonal (Filled Tonal)
471
- // ---------------------------------------------------------------------------
472
- &--tonal {
473
- background-color: t.color("secondary-container");
474
- color: t.color("on-secondary-container");
475
-
476
- // Plain and unselected toggles share the tonal container colours.
477
- &.#{$component}--selected {
478
- background-color: var(--#{base.$prefix}-icon-button-selected-container, #{t.color("secondary")});
479
- color: var(--#{base.$prefix}-icon-button-selected-color, #{t.color("on-secondary")});
480
- }
481
- }
482
-
483
- // ---------------------------------------------------------------------------
484
- // Variant: Outlined
485
- // ---------------------------------------------------------------------------
486
- &--outlined {
487
- background-color: transparent;
488
- color: t.color("on-surface-variant");
489
- border: get-size("s", outline-width) solid t.color("outline-variant");
490
-
491
- @each $size, $config in $sizes {
492
- &.#{$component}--#{$size} {
493
- border-width: map.get($config, outline-width);
494
- }
495
- }
496
-
497
- // Toggle selected state
498
- &.#{$component}--selected {
499
- background-color: t.color("inverse-surface");
500
- color: t.color("inverse-on-surface");
501
- border-color: transparent;
502
- }
503
- }
504
-
505
- // ---------------------------------------------------------------------------
506
- // Toggle mode
507
- // ---------------------------------------------------------------------------
508
- &--toggle {
509
- // Toggles use aria-pressed for accessibility
510
- // Shape morphs on selection (handled by selected class)
511
- }
512
-
513
- // Selected state - shape morphs (round becomes square, square becomes
514
- // round). Inside a toolbar the morph stays out: the toolbar pins the
515
- // round radius through the icon button's own override (see the toolbar
516
- // rule in _toolbar.scss), which an explicit
517
- // --…-button-shape-selected still beats.
518
- &--selected {
519
- // Round buttons become square when selected
520
- &.#{$component}--round:not(:active) {
521
- border-radius: var(
522
- --#{base.$prefix}-button-shape-selected,
523
- var(--#{base.$prefix}-icon-button-shape-selected, get-size("s", square-radius))
524
- );
525
-
526
- &.#{$component}--xs {
527
- border-radius: var(
528
- --#{base.$prefix}-button-shape-selected,
529
- var(--#{base.$prefix}-icon-button-shape-selected, get-size("xs", square-radius))
530
- );
531
- }
532
-
533
- &.#{$component}--m {
534
- border-radius: var(
535
- --#{base.$prefix}-button-shape-selected,
536
- var(--#{base.$prefix}-icon-button-shape-selected, get-size("m", square-radius))
537
- );
538
- }
539
-
540
- &.#{$component}--l {
541
- border-radius: var(
542
- --#{base.$prefix}-button-shape-selected,
543
- var(--#{base.$prefix}-icon-button-shape-selected, get-size("l", square-radius))
544
- );
545
- }
546
-
547
- &.#{$component}--xl {
548
- border-radius: var(
549
- --#{base.$prefix}-button-shape-selected,
550
- var(--#{base.$prefix}-icon-button-shape-selected, get-size("xl", square-radius))
551
- );
552
- }
553
- }
554
-
555
- // Square buttons become round when selected, with the real radius
556
- &.#{$component}--square:not(:active) {
557
- border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("s", round-radius));
558
-
559
- &.#{$component}--xs {
560
- border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xs", round-radius));
561
- }
562
-
563
- &.#{$component}--m {
564
- border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("m", round-radius));
565
- }
566
-
567
- &.#{$component}--l {
568
- border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("l", round-radius));
569
- }
570
-
571
- &.#{$component}--xl {
572
- border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xl", round-radius));
573
- }
574
- }
575
- }
576
-
577
- // ---------------------------------------------------------------------------
578
- // Disabled state
579
- // ---------------------------------------------------------------------------
580
- &:disabled,
581
- &.#{$component}--disabled {
582
- pointer-events: none;
583
- cursor: default;
584
-
585
- // Match toggle specificity so disabled colours win in every scheme.
586
- &.#{$component}--standard,
587
- &.#{$component}--filled,
588
- &.#{$component}--tonal,
589
- &.#{$component}--outlined {
590
- color: t.alpha("on-surface", 0.38);
591
- }
592
-
593
- &.#{$component}--filled,
594
- &.#{$component}--tonal {
595
- background-color: t.alpha("on-surface", 0.1);
596
- }
597
-
598
- &.#{$component}--outlined {
599
- border-color: t.color("outline-variant");
600
-
601
- &.#{$component}--selected {
602
- background-color: t.alpha("on-surface", 0.1);
603
- border-color: transparent;
604
- }
605
- }
606
-
607
- &::before {
608
- display: none;
609
- }
610
- }
91
+ position: relative;
92
+ display: inline-flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ border: none;
96
+ padding: 0;
97
+ background-color: transparent;
98
+ color: t.color("on-surface-variant");
99
+ font: inherit;
100
+ text-decoration: none;
101
+ cursor: pointer;
102
+ user-select: none;
103
+ vertical-align: middle;
104
+ appearance: none;
105
+ overflow: visible;
106
+ flex-shrink: 0;
107
+
108
+ width: get-size("s", container);
109
+ height: get-size("s", container);
110
+
111
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("s", round-radius));
112
+
113
+ transition:
114
+ background-color v.motion("duration-short2") v.motion("easing-standard"),
115
+ color v.motion("duration-short2") v.motion("easing-standard"),
116
+ border-color v.motion("duration-short2") v.motion("easing-standard"),
117
+ border-radius v.motion("duration-short1")
118
+ v.motion("easing-standard-accelerate"),
119
+ transform v.motion("duration-short1")
120
+ v.motion("easing-standard-accelerate"),
121
+ box-shadow v.motion("duration-short2") v.motion("easing-standard");
122
+
123
+ &:focus {
124
+ outline: none;
125
+ }
126
+
127
+ &:focus-visible {
128
+ outline: 2px solid t.color("outline");
129
+ outline-offset: 2px;
130
+ }
131
+
132
+ &::before {
133
+ content: "";
134
+ position: absolute;
135
+ top: 0;
136
+ left: 0;
137
+ right: 0;
138
+ bottom: 0;
139
+ background-color: currentColor;
140
+ opacity: 0;
141
+ pointer-events: none;
142
+ border-radius: inherit;
143
+ transition: opacity v.motion("duration-short2")
144
+ v.motion("easing-standard");
145
+ }
146
+
147
+ &:hover::before {
148
+ opacity: 0.08;
149
+ }
150
+
151
+ &:focus-visible::before {
152
+ opacity: 0.1;
153
+ }
154
+
155
+ &:active:not(:has(> .#{base.$prefix}-ripple))::before {
156
+ opacity: 0.1;
157
+ }
158
+
159
+ &__icon,
160
+ .#{base.$prefix}-icon,
161
+ .#{$component}__icon {
162
+ display: inline-flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ width: get-size("s", icon);
166
+ height: get-size("s", icon);
167
+ pointer-events: none;
168
+
169
+ svg {
170
+ width: 100%;
171
+ height: 100%;
172
+ }
173
+ }
174
+
175
+ &--xs {
176
+ width: get-size("xs", container);
177
+ height: get-size("xs", container);
178
+
179
+ .#{base.$prefix}-icon,
180
+ .#{$component}__icon {
181
+ width: get-size("xs", icon);
182
+ height: get-size("xs", icon);
183
+ }
184
+ }
185
+
186
+ &--xs::after,
187
+ &--s::after {
188
+ content: "";
189
+ position: absolute;
190
+ width: 48px;
191
+ height: 48px;
192
+ top: 50%;
193
+ left: 50%;
194
+ transform: translate(-50%, -50%);
195
+ }
196
+
197
+ &--m {
198
+ width: get-size("m", container);
199
+ height: get-size("m", container);
200
+
201
+ .#{base.$prefix}-icon,
202
+ .#{$component}__icon {
203
+ width: get-size("m", icon);
204
+ height: get-size("m", icon);
205
+ }
206
+ }
207
+
208
+ &--l {
209
+ width: get-size("l", container);
210
+ height: get-size("l", container);
211
+
212
+ .#{base.$prefix}-icon,
213
+ .#{$component}__icon {
214
+ width: get-size("l", icon);
215
+ height: get-size("l", icon);
216
+ }
217
+ }
218
+
219
+ &--xl {
220
+ width: get-size("xl", container);
221
+ height: get-size("xl", container);
222
+
223
+ .#{base.$prefix}-icon,
224
+ .#{$component}__icon {
225
+ width: get-size("xl", icon);
226
+ height: get-size("xl", icon);
227
+ }
228
+ }
229
+
230
+
231
+ &--round {
232
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("s", round-radius));
233
+
234
+ &.#{$component}--xs {
235
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("xs", round-radius));
236
+ }
237
+
238
+ &.#{$component}--m {
239
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("m", round-radius));
240
+ }
241
+
242
+ &.#{$component}--l {
243
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("l", round-radius));
244
+ }
245
+
246
+ &.#{$component}--xl {
247
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("xl", round-radius));
248
+ }
249
+ }
250
+
251
+ &--square {
252
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("s", square-radius));
253
+
254
+ &.#{$component}--xs {
255
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("xs", square-radius));
256
+ }
257
+
258
+ &.#{$component}--m {
259
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("m", square-radius));
260
+ }
261
+
262
+ &.#{$component}--l {
263
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("l", square-radius));
264
+ }
265
+
266
+ &.#{$component}--xl {
267
+ border-radius: var(--#{base.$prefix}-button-shape, get-size("xl", square-radius));
268
+ }
269
+ }
270
+
271
+ &:active {
272
+ &.#{$component}--round {
273
+ border-radius: var(
274
+ --#{base.$prefix}-button-shape-pressed,
275
+ var(--#{base.$prefix}-icon-button-shape-pressed, get-size("s", pressed-radius))
276
+ );
277
+
278
+ &.#{$component}--xs {
279
+ border-radius: var(
280
+ --#{base.$prefix}-button-shape-pressed,
281
+ var(--#{base.$prefix}-icon-button-shape-pressed, get-size("xs", pressed-radius))
282
+ );
283
+ }
284
+
285
+ &.#{$component}--m {
286
+ border-radius: var(
287
+ --#{base.$prefix}-button-shape-pressed,
288
+ var(--#{base.$prefix}-icon-button-shape-pressed, get-size("m", pressed-radius))
289
+ );
290
+ }
291
+
292
+ &.#{$component}--l {
293
+ border-radius: var(
294
+ --#{base.$prefix}-button-shape-pressed,
295
+ var(--#{base.$prefix}-icon-button-shape-pressed, get-size("l", pressed-radius))
296
+ );
297
+ }
298
+
299
+ &.#{$component}--xl {
300
+ border-radius: var(
301
+ --#{base.$prefix}-button-shape-pressed,
302
+ var(--#{base.$prefix}-icon-button-shape-pressed, get-size("xl", pressed-radius))
303
+ );
304
+ }
305
+ }
306
+
307
+ &.#{$component}--square {
308
+ border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("s", pressed-radius));
309
+
310
+ &.#{$component}--xs {
311
+ border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xs", pressed-radius));
312
+ }
313
+
314
+ &.#{$component}--m {
315
+ border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("m", pressed-radius));
316
+ }
317
+
318
+ &.#{$component}--l {
319
+ border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("l", pressed-radius));
320
+ }
321
+
322
+ &.#{$component}--xl {
323
+ border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xl", pressed-radius));
324
+ }
325
+ }
326
+ }
327
+
328
+ &--narrow {
329
+ width: get-width("s", narrow);
330
+
331
+ &.#{$component}--xs {
332
+ width: get-width("xs", narrow);
333
+ }
334
+
335
+ &.#{$component}--m {
336
+ width: get-width("m", narrow);
337
+ }
338
+
339
+ &.#{$component}--l {
340
+ width: get-width("l", narrow);
341
+ }
342
+
343
+ &.#{$component}--xl {
344
+ width: get-width("xl", narrow);
345
+ }
346
+ }
347
+
348
+ &--wide {
349
+ width: get-width("s", wide);
350
+
351
+ &.#{$component}--xs {
352
+ width: get-width("xs", wide);
353
+ }
354
+
355
+ &.#{$component}--m {
356
+ width: get-width("m", wide);
357
+ }
358
+
359
+ &.#{$component}--l {
360
+ width: get-width("l", wide);
361
+ }
362
+
363
+ &.#{$component}--xl {
364
+ width: get-width("xl", wide);
365
+ }
366
+ }
367
+
368
+ &--standard {
369
+ background-color: transparent;
370
+ color: var(--#{base.$prefix}-icon-button-standard-color, #{t.color("on-surface-variant")});
371
+
372
+ &.#{$component}--selected {
373
+ background-color: var(--#{base.$prefix}-icon-button-selected-container, transparent);
374
+ color: var(--#{base.$prefix}-icon-button-selected-color, #{t.color("primary")});
375
+ }
376
+ }
377
+
378
+ &--filled {
379
+ background-color: t.color("primary");
380
+ color: t.color("on-primary");
381
+
382
+ &.#{$component}--toggle:not(.#{$component}--selected) {
383
+ background-color: t.color("surface-container");
384
+ color: t.color("on-surface-variant");
385
+ }
386
+ }
387
+
388
+ &--tonal {
389
+ background-color: t.color("secondary-container");
390
+ color: t.color("on-secondary-container");
391
+
392
+ &.#{$component}--selected {
393
+ background-color: var(--#{base.$prefix}-icon-button-selected-container, #{t.color("secondary")});
394
+ color: var(--#{base.$prefix}-icon-button-selected-color, #{t.color("on-secondary")});
395
+ }
396
+ }
397
+
398
+ &--outlined {
399
+ background-color: transparent;
400
+ color: t.color("on-surface-variant");
401
+ border: get-size("s", outline-width) solid t.color("outline-variant");
402
+
403
+ @each $size, $config in $sizes {
404
+ &.#{$component}--#{$size} {
405
+ border-width: map.get($config, outline-width);
406
+ }
407
+ }
408
+
409
+ &.#{$component}--selected {
410
+ background-color: t.color("inverse-surface");
411
+ color: t.color("inverse-on-surface");
412
+ border-color: transparent;
413
+ }
414
+ }
415
+
416
+ &--toggle {
417
+ }
418
+
419
+ &--selected {
420
+ &.#{$component}--round:not(:active) {
421
+ border-radius: var(
422
+ --#{base.$prefix}-button-shape-selected,
423
+ var(--#{base.$prefix}-icon-button-shape-selected, get-size("s", square-radius))
424
+ );
425
+
426
+ &.#{$component}--xs {
427
+ border-radius: var(
428
+ --#{base.$prefix}-button-shape-selected,
429
+ var(--#{base.$prefix}-icon-button-shape-selected, get-size("xs", square-radius))
430
+ );
431
+ }
432
+
433
+ &.#{$component}--m {
434
+ border-radius: var(
435
+ --#{base.$prefix}-button-shape-selected,
436
+ var(--#{base.$prefix}-icon-button-shape-selected, get-size("m", square-radius))
437
+ );
438
+ }
439
+
440
+ &.#{$component}--l {
441
+ border-radius: var(
442
+ --#{base.$prefix}-button-shape-selected,
443
+ var(--#{base.$prefix}-icon-button-shape-selected, get-size("l", square-radius))
444
+ );
445
+ }
446
+
447
+ &.#{$component}--xl {
448
+ border-radius: var(
449
+ --#{base.$prefix}-button-shape-selected,
450
+ var(--#{base.$prefix}-icon-button-shape-selected, get-size("xl", square-radius))
451
+ );
452
+ }
453
+ }
454
+
455
+ &.#{$component}--square:not(:active) {
456
+ border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("s", round-radius));
457
+
458
+ &.#{$component}--xs {
459
+ border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xs", round-radius));
460
+ }
461
+
462
+ &.#{$component}--m {
463
+ border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("m", round-radius));
464
+ }
465
+
466
+ &.#{$component}--l {
467
+ border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("l", round-radius));
468
+ }
469
+
470
+ &.#{$component}--xl {
471
+ border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xl", round-radius));
472
+ }
473
+ }
474
+ }
475
+
476
+ &:disabled,
477
+ &.#{$component}--disabled {
478
+ pointer-events: none;
479
+ cursor: default;
480
+
481
+ &.#{$component}--standard,
482
+ &.#{$component}--filled,
483
+ &.#{$component}--tonal,
484
+ &.#{$component}--outlined {
485
+ color: t.alpha("on-surface", 0.38);
486
+ }
487
+
488
+ &.#{$component}--filled,
489
+ &.#{$component}--tonal {
490
+ background-color: t.alpha("on-surface", 0.1);
491
+ }
492
+
493
+ &.#{$component}--outlined {
494
+ border-color: t.color("outline-variant");
495
+
496
+ &.#{$component}--selected {
497
+ background-color: t.alpha("on-surface", 0.1);
498
+ border-color: transparent;
499
+ }
500
+ }
501
+
502
+ &::before {
503
+ display: none;
504
+ }
505
+ }
611
506
  }