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,9 +1,3 @@
1
- // src/styles/components/_progress.scss
2
- //
3
- // Progress indicator. The indicator itself is drawn on a canvas, which reads
4
- // its colours from the theme, so this stylesheet only lays the element out:
5
- // the 4dp inset from the container edge that the guidelines ask for, the
6
- // optional label, and the hidden and disabled states.
7
1
  @use "../../styles/abstract/base" as base;
8
2
  @use "../../styles/abstract/variables" as v;
9
3
  @use "../../styles/abstract/functions" as f;
@@ -14,95 +8,76 @@
14
8
  $component: "#{base.$prefix}-progress";
15
9
 
16
10
  .#{$component} {
17
- position: relative;
18
- display: block;
19
- // The canvas is the only child and defines the height; without this the
20
- // line box adds a few pixels under it
21
- line-height: 0;
11
+ position: relative;
12
+ display: block;
13
+ line-height: 0;
22
14
 
23
- &[hidden] {
24
- display: none;
25
- }
15
+ &[hidden] {
16
+ display: none;
17
+ }
26
18
 
27
- &__canvas {
28
- display: block;
29
- max-width: 100%;
30
- }
19
+ &__canvas {
20
+ display: block;
21
+ max-width: 100%;
22
+ }
31
23
 
32
- // ---------------------------------------------------------------------------
33
- // Linear: spans its container, inset 4dp from each edge
34
- // ---------------------------------------------------------------------------
35
- &--linear {
36
- width: 100%;
37
- padding: 0 #{4px};
38
- box-sizing: border-box;
39
- }
24
+ &--linear {
25
+ width: 100%;
26
+ padding: 0 #{4px};
27
+ box-sizing: border-box;
28
+ }
40
29
 
41
- // ---------------------------------------------------------------------------
42
- // Circular: sized by the canvas
43
- // ---------------------------------------------------------------------------
44
- &--circular {
45
- display: inline-flex;
46
- align-items: center;
47
- justify-content: center;
48
- vertical-align: middle;
49
- }
30
+ &--circular {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ vertical-align: middle;
35
+ }
50
36
 
51
- // ---------------------------------------------------------------------------
52
- // Label, an extension of this library rather than an M3 element
53
- // ---------------------------------------------------------------------------
54
- &__label {
55
- @include m.typography("label-medium");
56
- position: absolute;
57
- line-height: normal;
58
- color: t.color("on-surface-variant");
59
- white-space: nowrap;
37
+ &__label {
38
+ @include m.typography("label-medium");
39
+ position: absolute;
40
+ line-height: normal;
41
+ color: t.color("on-surface-variant");
42
+ white-space: nowrap;
60
43
 
61
- .#{$component}--linear & {
62
- @include d.end(0, $arm: false);
63
- top: 100%;
64
- margin-top: 4px;
65
- }
44
+ .#{$component}--linear & {
45
+ @include d.end(0, $arm: false);
46
+ top: 100%;
47
+ margin-top: 4px;
48
+ }
66
49
 
67
- .#{$component}--circular & {
68
- top: 50%;
69
- left: 50%;
70
- transform: translate(-50%, -50%);
71
- }
72
- }
50
+ .#{$component}--circular & {
51
+ top: 50%;
52
+ left: 50%;
53
+ transform: translate(-50%, -50%);
54
+ }
55
+ }
73
56
 
74
- // The label's mirrored inset, in one arm that also covers a marker on this
75
- // root: --linear and the runtime's direction mark are the same element, and
76
- // the plain arm members need the marker on an ancestor
77
- // (abstract/_direction.scss). Nothing of it in the logical form.
78
- &--linear {
79
- @include d.arms($self: true) {
80
- .#{$component}__label {
81
- right: auto;
82
- left: 0;
83
- }
84
- }
85
- }
57
+ &--linear {
58
+ @include d.arms($self: true) {
59
+ .#{$component}__label {
60
+ right: auto;
61
+ left: 0;
62
+ }
63
+ }
64
+ }
86
65
 
87
- // A linear indicator with a label leaves room for it underneath
88
- &--linear:has(.#{$component}__label) {
89
- margin-bottom: 20px;
90
- }
66
+ &--linear:has(.#{$component}__label) {
67
+ margin-bottom: 20px;
68
+ }
91
69
 
92
- // ---------------------------------------------------------------------------
93
- // States
94
- // ---------------------------------------------------------------------------
95
- &--disabled,
96
- &[aria-disabled="true"] {
97
- opacity: 0.38;
98
- pointer-events: none;
99
- }
70
+ &--disabled,
71
+ &[aria-disabled="true"] {
72
+ opacity: 0.38;
73
+ pointer-events: none;
74
+ }
100
75
 
101
- &--transition {
102
- transition: opacity v.motion("duration-short4") v.motion("easing-standard");
103
- }
76
+ &--transition {
77
+ transition: opacity v.motion("duration-short4") v.motion("easing-standard");
78
+ }
104
79
 
105
- @include m.print {
106
- display: none;
107
- }
80
+ @include m.print {
81
+ display: none;
82
+ }
108
83
  }
@@ -1,4 +1,3 @@
1
- // src/components/radios/_styles.scss
2
1
  @use '../../styles/abstract/base' as base;
3
2
  @use '../../styles/abstract/variables' as v;
4
3
  @use '../../styles/abstract/functions' as f;
@@ -8,210 +7,174 @@
8
7
  $component: '#{base.$prefix}-radios';
9
8
 
10
9
  .#{$component} {
11
- display: flex;
12
- margin: 0;
13
- padding: 0;
14
-
15
- // Vertical layout (default)
16
- &--vertical {
17
- flex-direction: column;
18
-
19
- // Each option is its own 48dp target, so the rows stack with no gap between
20
- // them (a 12px margin made the pitch 60px).
21
- }
22
-
23
- // Horizontal layout. align-items stays flex-start: options on one line share
24
- // the start edge, and the next line starts after the tallest row.
25
- &--horizontal {
26
- flex-direction: row;
27
- flex-wrap: wrap;
28
- align-items: flex-start;
29
-
30
- .#{$component}__item {
31
- margin-inline-end: 16px;
32
-
33
- &:last-child {
34
- margin-inline-end: 0;
35
- }
36
- }
37
- }
38
-
39
- // Disabled state
40
- // No blanket dimming: DisabledSelectedIconOpacity and
41
- // DisabledUnselectedIconOpacity are both 0.38, applied per role below.
42
- &--disabled {
43
- pointer-events: none;
44
- }
45
-
46
- // Radio item
47
- &__item {
48
- position: relative;
49
- display: inline-flex;
50
- align-items: center;
51
-
52
- &--disabled {
53
- cursor: not-allowed;
54
-
55
- .#{$component}__label {
56
- cursor: not-allowed;
57
- }
58
- }
59
- }
60
-
61
- // Radio input
62
- &__input {
63
- font: inherit;
64
- position: absolute;
65
- opacity: 0;
66
- height: 0;
67
- width: 0;
68
- margin: 0;
69
- padding: 0;
70
-
71
- // Selected: a primary ring and dot.
72
- &:checked ~ .#{$component}__label .#{$component}__circle {
73
- border-color: t.color('primary');
74
-
75
- &::after {
76
- transform: translate(-50%, -50%) scale(1);
77
- opacity: 1;
78
- }
79
- }
80
-
81
- // Disabled styles
82
- &:disabled ~ .#{$component}__label {
83
- .#{$component}__circle {
84
- border-color: t.alpha('on-surface', 0.38);
85
-
86
- &::after {
87
- background-color: t.alpha('on-surface', 0.38);
88
- }
89
- }
90
-
91
- .#{$component}__text {
92
- color: t.alpha('on-surface', 0.38);
93
- }
94
- }
95
- }
96
-
97
- // Radio label. The row is at least 48dp and grows with a wrapping label.
98
- // 4px of vertical padding leaves a 40px content box, so a one-line row stays
99
- // 48px: the control's top is 4px and the 20px circle's top is 14px. The
100
- // circle stays centred on the label block (align-items: center).
101
- &__label {
102
- position: relative;
103
- display: inline-flex;
104
- align-items: center;
105
- cursor: pointer;
106
- padding: 4px 0;
107
- min-height: 48px;
108
- // Without the base reset: the 4px padding must stay inside the 48px row.
109
- box-sizing: border-box;
110
- color: t.color('on-surface');
111
-
112
- // Body Large, as the checkbox and switch labels: a list item's headline.
113
- @include m.typography('body-large');
114
-
115
- // The text already comes first in the DOM (radio.ts); reversing the row put it
116
- // back after the control.
117
- &--before {
118
- .#{$component}__text {
119
- margin-inline: 0 8px;
120
- }
121
- }
122
-
123
- // An empty label leaves the 40px control. The row is the 48dp target and
124
- // the control is centred in it: the circle inset is 14px and the state
125
- // layer inset is 4px. Without the width the row would be 40px.
126
- &:has(> .#{$component}__text:empty) {
127
- min-width: 48px;
128
- justify-content: center;
129
- }
130
- }
131
-
132
- // Radio control: the 40dp state layer area
133
- &__control {
134
- position: relative;
135
- display: inline-flex;
136
- align-items: center;
137
- justify-content: center;
138
- width: 40px;
139
- height: 40px;
140
- flex-shrink: 0;
141
- }
142
-
143
- // The 20dp icon: a 2dp ring (RadioStrokeWidth; it was 1.5px, which Chromium
144
- // paints as 1px) in on-surface-variant, and a 10dp dot (Compose and material-web;
145
- // it was 12px) that springs in on the fast spatial spring.
146
- &__circle {
147
- position: relative;
148
- width: 20px;
149
- height: 20px;
150
- border: 2px solid t.color('on-surface-variant');
151
- border-radius: 50%;
152
- box-sizing: border-box;
153
- transition: m.spring(border-color, fast-effects);
154
-
155
- &::after {
156
- content: '';
157
- position: absolute;
158
- top: 50%;
159
- left: 50%;
160
- transform: translate(-50%, -50%) scale(0);
161
- width: 10px;
162
- height: 10px;
163
- border-radius: 50%;
164
- background-color: t.color('primary');
165
- opacity: 0;
166
- transition: m.spring(transform, fast-spatial), m.spring(opacity, fast-effects);
167
- }
168
- }
169
-
170
- // The state layer (md-comp-radio-button): unselected on-surface on hover and
171
- // focus, selected primary; a press takes the colour of the state it leads to. The
172
- // unselected ring turns on-surface. Hover was primary even when unselected, a
173
- // plain :focus showed on mouse clicks, and there was no press.
174
- &__ripple {
175
- position: absolute;
176
- inset: 0;
177
- border-radius: 50%;
178
- transition: m.spring(background-color, fast-effects);
179
- }
180
-
181
- &__item {
182
- $input: '.#{$component}__input:not(:disabled)';
183
- $label: '.#{$component}__label';
184
- $ripple: '.#{$component}__ripple';
185
-
186
- #{$input}:not(:checked) ~ #{$label}:is(:hover, :active) .#{$component}__circle,
187
- #{$input}:not(:checked):focus-visible ~ #{$label} .#{$component}__circle {
188
- border-color: t.color('on-surface');
189
- }
190
-
191
- #{$input} ~ #{$label}:hover #{$ripple} { background-color: t.alpha('on-surface', v.state('hover-state-layer-opacity')); }
192
- #{$input}:focus-visible ~ #{$label} #{$ripple} { background-color: t.alpha('on-surface', v.state('focus-state-layer-opacity')); }
193
- #{$input} ~ #{$label}:active #{$ripple} { background-color: t.alpha('primary', v.state('pressed-state-layer-opacity')); }
194
-
195
- #{$input}:checked ~ #{$label}:hover #{$ripple} { background-color: t.alpha('primary', v.state('hover-state-layer-opacity')); }
196
- #{$input}:checked:focus-visible ~ #{$label} #{$ripple} { background-color: t.alpha('primary', v.state('focus-state-layer-opacity')); }
197
- #{$input}:checked ~ #{$label}:active #{$ripple} { background-color: t.alpha('on-surface', v.state('pressed-state-layer-opacity')); }
198
-
199
- // md.comp.focus-ring: 3dp secondary, 2dp outside the state layer.
200
- #{$input}:focus-visible ~ #{$label} #{$ripple} {
201
- outline: 3px solid t.color('secondary');
202
- outline-offset: 2px;
203
- }
204
- }
205
-
206
- // Radio text: the gap follows the reading direction (it was a physical
207
- // margin-left, 0px in right-to-left layouts).
208
- &__text {
209
- margin-inline-start: 8px;
210
-
211
- // An empty span would still take the 8px gap and push the control to the
212
- // inline start. Taking no space lets the unlabelled row centre it.
213
- &:empty {
214
- display: none;
215
- }
216
- }
10
+ display: flex;
11
+ margin: 0;
12
+ padding: 0;
13
+
14
+ &--vertical {
15
+ flex-direction: column;
16
+
17
+ }
18
+
19
+ &--horizontal {
20
+ flex-direction: row;
21
+ flex-wrap: wrap;
22
+ align-items: flex-start;
23
+
24
+ .#{$component}__item {
25
+ margin-inline-end: 16px;
26
+
27
+ &:last-child {
28
+ margin-inline-end: 0;
29
+ }
30
+ }
31
+ }
32
+
33
+ &--disabled {
34
+ pointer-events: none;
35
+ }
36
+
37
+ &__item {
38
+ position: relative;
39
+ display: inline-flex;
40
+ align-items: center;
41
+
42
+ &--disabled {
43
+ cursor: not-allowed;
44
+
45
+ .#{$component}__label {
46
+ cursor: not-allowed;
47
+ }
48
+ }
49
+ }
50
+
51
+ &__input {
52
+ font: inherit;
53
+ position: absolute;
54
+ opacity: 0;
55
+ height: 0;
56
+ width: 0;
57
+ margin: 0;
58
+ padding: 0;
59
+
60
+ &:checked ~ .#{$component}__label .#{$component}__circle {
61
+ border-color: t.color('primary');
62
+
63
+ &::after {
64
+ transform: translate(-50%, -50%) scale(1);
65
+ opacity: 1;
66
+ }
67
+ }
68
+
69
+ &:disabled ~ .#{$component}__label {
70
+ .#{$component}__circle {
71
+ border-color: t.alpha('on-surface', 0.38);
72
+
73
+ &::after {
74
+ background-color: t.alpha('on-surface', 0.38);
75
+ }
76
+ }
77
+
78
+ .#{$component}__text {
79
+ color: t.alpha('on-surface', 0.38);
80
+ }
81
+ }
82
+ }
83
+
84
+ &__label {
85
+ position: relative;
86
+ display: inline-flex;
87
+ align-items: center;
88
+ cursor: pointer;
89
+ padding: 4px 0;
90
+ min-height: 48px;
91
+ box-sizing: border-box;
92
+ color: t.color('on-surface');
93
+
94
+ @include m.typography('body-large');
95
+
96
+ &--before {
97
+ .#{$component}__text {
98
+ margin-inline: 0 8px;
99
+ }
100
+ }
101
+
102
+ &:has(> .#{$component}__text:empty) {
103
+ min-width: 48px;
104
+ justify-content: center;
105
+ }
106
+ }
107
+
108
+ &__control {
109
+ position: relative;
110
+ display: inline-flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ width: 40px;
114
+ height: 40px;
115
+ flex-shrink: 0;
116
+ }
117
+
118
+ &__circle {
119
+ position: relative;
120
+ width: 20px;
121
+ height: 20px;
122
+ border: 2px solid t.color('on-surface-variant');
123
+ border-radius: 50%;
124
+ box-sizing: border-box;
125
+ transition: m.spring(border-color, fast-effects);
126
+
127
+ &::after {
128
+ content: '';
129
+ position: absolute;
130
+ top: 50%;
131
+ left: 50%;
132
+ transform: translate(-50%, -50%) scale(0);
133
+ width: 10px;
134
+ height: 10px;
135
+ border-radius: 50%;
136
+ background-color: t.color('primary');
137
+ opacity: 0;
138
+ transition: m.spring(transform, fast-spatial), m.spring(opacity, fast-effects);
139
+ }
140
+ }
141
+
142
+ &__ripple {
143
+ position: absolute;
144
+ inset: 0;
145
+ border-radius: 50%;
146
+ transition: m.spring(background-color, fast-effects);
147
+ }
148
+
149
+ &__item {
150
+ $input: '.#{$component}__input:not(:disabled)';
151
+ $label: '.#{$component}__label';
152
+ $ripple: '.#{$component}__ripple';
153
+
154
+ #{$input}:not(:checked) ~ #{$label}:is(:hover, :active) .#{$component}__circle,
155
+ #{$input}:not(:checked):focus-visible ~ #{$label} .#{$component}__circle {
156
+ border-color: t.color('on-surface');
157
+ }
158
+
159
+ #{$input} ~ #{$label}:hover #{$ripple} { background-color: t.alpha('on-surface', v.state('hover-state-layer-opacity')); }
160
+ #{$input}:focus-visible ~ #{$label} #{$ripple} { background-color: t.alpha('on-surface', v.state('focus-state-layer-opacity')); }
161
+ #{$input} ~ #{$label}:active #{$ripple} { background-color: t.alpha('primary', v.state('pressed-state-layer-opacity')); }
162
+
163
+ #{$input}:checked ~ #{$label}:hover #{$ripple} { background-color: t.alpha('primary', v.state('hover-state-layer-opacity')); }
164
+ #{$input}:checked:focus-visible ~ #{$label} #{$ripple} { background-color: t.alpha('primary', v.state('focus-state-layer-opacity')); }
165
+ #{$input}:checked ~ #{$label}:active #{$ripple} { background-color: t.alpha('on-surface', v.state('pressed-state-layer-opacity')); }
166
+
167
+ #{$input}:focus-visible ~ #{$label} #{$ripple} {
168
+ outline: 3px solid t.color('secondary');
169
+ outline-offset: 2px;
170
+ }
171
+ }
172
+
173
+ &__text {
174
+ margin-inline-start: 8px;
175
+
176
+ &:empty {
177
+ display: none;
178
+ }
179
+ }
217
180
  }