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,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
  }