@material/web 0.1.0-alpha.2 → 1.0.0-pre.1

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 (237) hide show
  1. package/autocomplete/lib/_filled-autocomplete.scss +3 -4
  2. package/autocomplete/lib/_outlined-autocomplete.scss +3 -3
  3. package/autocomplete/lib/_shared.scss +2 -7
  4. package/autocomplete/lib/filled-styles.css.js +1 -1
  5. package/autocomplete/lib/filled-styles.css.js.map +1 -1
  6. package/autocomplete/lib/outlined-styles.css.js +1 -1
  7. package/autocomplete/lib/outlined-styles.css.js.map +1 -1
  8. package/button/lib/_elevated-button.scss +6 -0
  9. package/button/lib/_elevation.scss +30 -28
  10. package/button/lib/_filled-button.scss +6 -0
  11. package/button/lib/_icon.scss +5 -12
  12. package/button/lib/_outlined-button.scss +10 -1
  13. package/button/lib/_shared.scss +16 -6
  14. package/button/lib/_text-button.scss +6 -0
  15. package/button/lib/_tonal-button.scss +6 -0
  16. package/button/lib/button.d.ts +1 -11
  17. package/button/lib/button.js +5 -30
  18. package/button/lib/button.js.map +1 -1
  19. package/button/lib/elevated-styles.css.js +1 -1
  20. package/button/lib/elevated-styles.css.js.map +1 -1
  21. package/button/lib/filled-styles.css.js +1 -1
  22. package/button/lib/filled-styles.css.js.map +1 -1
  23. package/button/lib/outlined-styles.css.js +1 -1
  24. package/button/lib/outlined-styles.css.js.map +1 -1
  25. package/button/lib/shared-elevation-styles.css.js +1 -1
  26. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  27. package/button/lib/shared-styles.css.js +1 -1
  28. package/button/lib/shared-styles.css.js.map +1 -1
  29. package/button/lib/text-styles.css.js +1 -1
  30. package/button/lib/text-styles.css.js.map +1 -1
  31. package/button/lib/tonal-styles.css.js +1 -1
  32. package/button/lib/tonal-styles.css.js.map +1 -1
  33. package/checkbox/lib/_checkbox.scss +4 -0
  34. package/checkbox/lib/checkbox-styles.css.js +1 -1
  35. package/checkbox/lib/checkbox-styles.css.js.map +1 -1
  36. package/chips/chip/lib/_chip-theme.scss +19 -23
  37. package/chips/chip/lib/_chip.scss +0 -2
  38. package/chips/chip/lib/_input-chip-theme.scss +16 -26
  39. package/chips/chip/lib/chip.d.ts +1 -0
  40. package/chips/chip/lib/chip.js +2 -1
  41. package/chips/chip/lib/chip.js.map +1 -1
  42. package/fab/fab-extended.js +1 -2
  43. package/fab/fab-extended.js.map +1 -1
  44. package/fab/fab.js +1 -2
  45. package/fab/fab.js.map +1 -1
  46. package/fab/lib/_shared.scss +11 -9
  47. package/fab/lib/fab-shared-styles.css.js +1 -1
  48. package/fab/lib/fab-shared-styles.css.js.map +1 -1
  49. package/field/lib/filled-styles.css.js +1 -1
  50. package/field/lib/filled-styles.css.js.map +1 -1
  51. package/icon/lib/_icon.scss +8 -5
  52. package/icon/lib/icon-styles.css.js +1 -1
  53. package/icon/lib/icon-styles.css.js.map +1 -1
  54. package/iconbutton/lib/_filled-icon-button.scss +14 -0
  55. package/iconbutton/lib/_filled-tonal-icon-button.scss +14 -0
  56. package/iconbutton/lib/_outlined-icon-button.scss +16 -17
  57. package/iconbutton/lib/_shared.scss +29 -16
  58. package/iconbutton/lib/_standard-icon-button.scss +16 -0
  59. package/iconbutton/lib/filled-styles.css.js +1 -1
  60. package/iconbutton/lib/filled-styles.css.js.map +1 -1
  61. package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
  62. package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
  63. package/iconbutton/lib/icon-button-toggle.js +1 -1
  64. package/iconbutton/lib/icon-button-toggle.js.map +1 -1
  65. package/iconbutton/lib/icon-button.js +1 -1
  66. package/iconbutton/lib/icon-button.js.map +1 -1
  67. package/iconbutton/lib/outlined-styles.css.js +1 -1
  68. package/iconbutton/lib/outlined-styles.css.js.map +1 -1
  69. package/iconbutton/lib/shared-styles.css.js +1 -1
  70. package/iconbutton/lib/shared-styles.css.js.map +1 -1
  71. package/iconbutton/lib/standard-styles.css.js +1 -1
  72. package/iconbutton/lib/standard-styles.css.js.map +1 -1
  73. package/list/lib/_list.scss +20 -14
  74. package/list/lib/divider/list-divider.js +2 -0
  75. package/list/lib/divider/list-divider.js.map +1 -1
  76. package/list/lib/list-styles.css.js +1 -1
  77. package/list/lib/list-styles.css.js.map +1 -1
  78. package/list/lib/list.d.ts +1 -0
  79. package/list/lib/list.js +4 -1
  80. package/list/lib/list.js.map +1 -1
  81. package/list/lib/listitem/list-item.js +2 -0
  82. package/list/lib/listitem/list-item.js.map +1 -1
  83. package/menu/lib/_menu.scss +7 -10
  84. package/menu/lib/menu-styles.css.js +1 -1
  85. package/menu/lib/menu-styles.css.js.map +1 -1
  86. package/menusurface/lib/_md-comp-menu-surface.scss +6 -14
  87. package/menusurface/lib/_menu-surface.scss +8 -4
  88. package/menusurface/lib/menu-surface-styles.css.js +1 -1
  89. package/menusurface/lib/menu-surface-styles.css.js.map +1 -1
  90. package/menusurface/lib/menu-surface.d.ts +1 -0
  91. package/menusurface/lib/menu-surface.js +2 -0
  92. package/menusurface/lib/menu-surface.js.map +1 -1
  93. package/navigationdrawer/lib/_navigation-drawer-modal.scss +7 -22
  94. package/navigationdrawer/lib/_navigation-drawer.scss +15 -18
  95. package/navigationdrawer/lib/_shared.scss +2 -7
  96. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
  97. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
  98. package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
  99. package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
  100. package/navigationdrawer/lib/navigation-drawer.d.ts +1 -0
  101. package/navigationdrawer/lib/navigation-drawer.js +3 -2
  102. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  103. package/package.json +8 -1
  104. package/radio/_radio.scss +6 -1
  105. package/radio/lib/_radio.scss +127 -91
  106. package/{elevationold/lib/elevation-overlay-styles.css.d.ts → radio/lib/forced-colors-styles.css.d.ts} +0 -0
  107. package/radio/lib/forced-colors-styles.css.js +9 -0
  108. package/radio/lib/forced-colors-styles.css.js.map +1 -0
  109. package/radio/lib/forced-colors-styles.scss +27 -0
  110. package/radio/lib/radio-styles.css.js +1 -1
  111. package/radio/lib/radio-styles.css.js.map +1 -1
  112. package/radio/lib/radio-styles.scss +1 -7
  113. package/radio/lib/radio.d.ts +6 -44
  114. package/radio/lib/radio.js +42 -144
  115. package/radio/lib/radio.js.map +1 -1
  116. package/radio/lib/single-selection-controller.d.ts +51 -138
  117. package/radio/lib/single-selection-controller.js +153 -249
  118. package/radio/lib/single-selection-controller.js.map +1 -1
  119. package/radio/radio.js +2 -1
  120. package/radio/radio.js.map +1 -1
  121. package/textfield/lib/_shared.scss +1 -0
  122. package/textfield/lib/filled-styles.css.js +1 -1
  123. package/textfield/lib/filled-styles.css.js.map +1 -1
  124. package/textfield/lib/shared-styles.css.js +1 -1
  125. package/textfield/lib/shared-styles.css.js.map +1 -1
  126. package/textfield/lib/text-field.js +3 -0
  127. package/textfield/lib/text-field.js.map +1 -1
  128. package/tokens/_index.scss +1 -1
  129. package/tokens/{v0_144 → v0_150}/_index.scss +0 -0
  130. package/tokens/{v0_144 → v0_150}/_md-comp-assist-chip.scss +1 -1
  131. package/tokens/{v0_144 → v0_150}/_md-comp-badge.scss +1 -1
  132. package/tokens/{v0_144 → v0_150}/_md-comp-banner.scss +1 -1
  133. package/tokens/{v0_144 → v0_150}/_md-comp-bottom-app-bar.scss +1 -1
  134. package/tokens/{v0_144 → v0_150}/_md-comp-carousel-item.scss +1 -1
  135. package/tokens/{v0_144 → v0_150}/_md-comp-checkbox.scss +1 -1
  136. package/tokens/{v0_144 → v0_150}/_md-comp-circular-progress-indicator.scss +1 -1
  137. package/tokens/{v0_144 → v0_150}/_md-comp-data-table.scss +1 -1
  138. package/tokens/{v0_144 → v0_150}/_md-comp-date-input-modal.scss +1 -1
  139. package/tokens/{v0_144 → v0_150}/_md-comp-date-picker-docked.scss +1 -1
  140. package/tokens/{v0_144 → v0_150}/_md-comp-date-picker-modal.scss +1 -1
  141. package/tokens/{v0_144 → v0_150}/_md-comp-dialog.scss +1 -1
  142. package/tokens/{v0_144 → v0_150}/_md-comp-divider.scss +1 -1
  143. package/tokens/{v0_144 → v0_150}/_md-comp-elevated-button.scss +1 -1
  144. package/tokens/{v0_144 → v0_150}/_md-comp-elevated-card.scss +1 -1
  145. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-branded.scss +1 -1
  146. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-primary.scss +1 -1
  147. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-secondary.scss +1 -1
  148. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-surface.scss +1 -1
  149. package/tokens/{v0_144 → v0_150}/_md-comp-extended-fab-tertiary.scss +1 -1
  150. package/tokens/{v0_144 → v0_150}/_md-comp-fab-branded-large.scss +1 -1
  151. package/tokens/{v0_144 → v0_150}/_md-comp-fab-branded.scss +1 -1
  152. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary-large.scss +1 -1
  153. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary-small.scss +1 -1
  154. package/tokens/{v0_144 → v0_150}/_md-comp-fab-primary.scss +1 -1
  155. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary-large.scss +1 -1
  156. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary-small.scss +1 -1
  157. package/tokens/{v0_144 → v0_150}/_md-comp-fab-secondary.scss +1 -1
  158. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface-large.scss +1 -1
  159. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface-small.scss +1 -1
  160. package/tokens/{v0_144 → v0_150}/_md-comp-fab-surface.scss +1 -1
  161. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary-large.scss +1 -1
  162. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary-small.scss +1 -1
  163. package/tokens/{v0_144 → v0_150}/_md-comp-fab-tertiary.scss +1 -1
  164. package/tokens/{v0_144 → v0_150}/_md-comp-filled-autocomplete.scss +1 -1
  165. package/tokens/{v0_144 → v0_150}/_md-comp-filled-button.scss +1 -1
  166. package/tokens/{v0_144 → v0_150}/_md-comp-filled-card.scss +1 -1
  167. package/tokens/{v0_144 → v0_150}/_md-comp-filled-icon-button.scss +1 -1
  168. package/tokens/{v0_144 → v0_150}/_md-comp-filled-menu-button.scss +1 -1
  169. package/tokens/{v0_144 → v0_150}/_md-comp-filled-select.scss +1 -1
  170. package/tokens/{v0_144 → v0_150}/_md-comp-filled-text-field.scss +2 -2
  171. package/tokens/{v0_144 → v0_150}/_md-comp-filled-tonal-button.scss +1 -1
  172. package/tokens/{v0_144 → v0_150}/_md-comp-filled-tonal-icon-button.scss +1 -1
  173. package/tokens/{v0_144 → v0_150}/_md-comp-filter-chip.scss +2 -1
  174. package/tokens/{v0_144 → v0_150}/_md-comp-full-screen-dialog.scss +1 -1
  175. package/tokens/{v0_144 → v0_150}/_md-comp-icon-button.scss +1 -1
  176. package/tokens/{v0_144 → v0_150}/_md-comp-input-chip.scss +1 -1
  177. package/tokens/{v0_144 → v0_150}/_md-comp-linear-progress-indicator.scss +1 -1
  178. package/tokens/{v0_144 → v0_150}/_md-comp-list.scss +1 -1
  179. package/tokens/{v0_144 → v0_150}/_md-comp-menu.scss +1 -1
  180. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-bar.scss +1 -1
  181. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-drawer.scss +1 -1
  182. package/tokens/{v0_144 → v0_150}/_md-comp-navigation-rail.scss +1 -1
  183. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-autocomplete.scss +1 -1
  184. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-button.scss +1 -1
  185. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-card.scss +5 -5
  186. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-icon-button.scss +1 -1
  187. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-menu-button.scss +1 -1
  188. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-segmented-button.scss +1 -1
  189. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-select.scss +1 -1
  190. package/tokens/{v0_144 → v0_150}/_md-comp-outlined-text-field.scss +1 -1
  191. package/tokens/{v0_144 → v0_150}/_md-comp-plain-tooltip.scss +2 -2
  192. package/tokens/{v0_144 → v0_150}/_md-comp-primary-navigation-tab.scss +1 -1
  193. package/tokens/{v0_144 → v0_150}/_md-comp-radio-button.scss +1 -1
  194. package/tokens/{v0_144 → v0_150}/_md-comp-rich-tooltip.scss +1 -1
  195. package/tokens/{v0_144 → v0_150}/_md-comp-scrim.scss +1 -1
  196. package/tokens/{v0_144 → v0_150}/_md-comp-search-bar.scss +1 -1
  197. package/tokens/{v0_144 → v0_150}/_md-comp-search-view.scss +1 -1
  198. package/tokens/{v0_144 → v0_150}/_md-comp-secondary-navigation-tab.scss +1 -1
  199. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-bottom.scss +1 -1
  200. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-floating.scss +1 -1
  201. package/tokens/{v0_144 → v0_150}/_md-comp-sheet-side.scss +1 -1
  202. package/tokens/{v0_144 → v0_150}/_md-comp-slider.scss +1 -1
  203. package/tokens/{v0_144 → v0_150}/_md-comp-snackbar.scss +25 -1
  204. package/tokens/{v0_144 → v0_150}/_md-comp-standard-menu-button.scss +1 -1
  205. package/tokens/{v0_144 → v0_150}/_md-comp-suggestion-chip.scss +6 -6
  206. package/tokens/{v0_144 → v0_150}/_md-comp-switch.scss +1 -1
  207. package/tokens/{v0_144 → v0_150}/_md-comp-text-button.scss +1 -1
  208. package/tokens/{v0_144 → v0_150}/_md-comp-time-input.scss +1 -1
  209. package/tokens/{v0_144 → v0_150}/_md-comp-time-picker.scss +2 -2
  210. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-large.scss +1 -1
  211. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-medium.scss +1 -1
  212. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-small-centered.scss +1 -1
  213. package/tokens/{v0_144 → v0_150}/_md-comp-top-app-bar-small.scss +1 -1
  214. package/tokens/{v0_144 → v0_150}/_md-ref-palette.scss +1 -1
  215. package/tokens/{v0_144 → v0_150}/_md-ref-typeface.scss +1 -1
  216. package/tokens/{v0_144 → v0_150}/_md-sys-color.scss +1 -1
  217. package/tokens/{v0_144 → v0_150}/_md-sys-elevation.scss +1 -1
  218. package/tokens/{v0_144 → v0_150}/_md-sys-motion.scss +1 -1
  219. package/tokens/{v0_144 → v0_150}/_md-sys-shape.scss +1 -1
  220. package/tokens/{v0_144 → v0_150}/_md-sys-state.scss +1 -1
  221. package/tokens/{v0_144 → v0_150}/_md-sys-typescale.scss +1 -1
  222. package/tokens/v0_150/index.test.css.d.ts +1 -0
  223. package/tokens/v0_150/index.test.css.js +9 -0
  224. package/tokens/v0_150/index.test.css.js.map +1 -0
  225. package/tokens/v0_150/index.test.scss +584 -0
  226. package/tokens/v0_150/lib.test.css.d.ts +1 -0
  227. package/tokens/v0_150/lib.test.css.js +9 -0
  228. package/tokens/v0_150/lib.test.css.js.map +1 -0
  229. package/tokens/v0_150/lib.test.scss +663 -0
  230. package/elevationold/lib/_elevation-overlay-theme.scss +0 -31
  231. package/elevationold/lib/_elevation-overlay.scss +0 -18
  232. package/elevationold/lib/_elevation-theme.scss +0 -74
  233. package/elevationold/lib/_surface.scss +0 -15
  234. package/elevationold/lib/elevation-overlay-styles.css.js +0 -9
  235. package/elevationold/lib/elevation-overlay-styles.css.js.map +0 -1
  236. package/elevationold/lib/elevation-overlay-styles.scss +0 -9
  237. package/radio/lib/_radio-theme.scss +0 -377
@@ -1,74 +0,0 @@
1
- //
2
- // Copyright 2021 Google LLC
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
-
6
- @use 'sass:map';
7
- @use 'sass:meta';
8
- @use '../../sass/theme';
9
- @use '../../sass/var';
10
- @use './elevation-overlay-theme';
11
-
12
- @function resolve-theme(
13
- $theme,
14
- $resolver,
15
- $shadow-color-token,
16
- $elevation-tokens
17
- ) {
18
- @if $resolver == null {
19
- @return $theme;
20
- }
21
-
22
- $shadow-color: map.get($theme, $shadow-color-token);
23
-
24
- // Resolve the value for each state key.
25
- @each $token in $elevation-tokens {
26
- $value: map.get($theme, $token);
27
- $elevation-theme: meta.call(
28
- $resolver,
29
- $elevation: $value,
30
- $shadow-color: $shadow-color
31
- );
32
-
33
- @each $resolved-token, $resolved-value in $elevation-theme {
34
- $theme: map.set($theme, #{$token}-#{$resolved-token}, $resolved-value);
35
- }
36
-
37
- // clean up unused elevation token
38
- $theme: map.remove($theme, $token);
39
- }
40
-
41
- // clean up unused shadow color token
42
- $theme: map.remove($theme, $shadow-color-token);
43
-
44
- @return $theme;
45
- }
46
-
47
- /// Represents the configurable values of the elevation theme.
48
- $_flat-theme: map.merge(
49
- elevation-overlay-theme.$transparent-theme,
50
- (
51
- shadow: none,
52
- )
53
- );
54
-
55
- /// Applies the given theme styles.
56
- ///
57
- /// @param {Map} $theme - @see $_flat-theme for accepted theme properties.
58
- @mixin theme-styles($theme) {
59
- $theme: theme.validate-theme-styles(
60
- $_flat-theme,
61
- $theme,
62
- $require-all: false
63
- );
64
-
65
- @include _box-shadow(map.get($theme, shadow));
66
- @include elevation-overlay-theme.theme-styles($theme);
67
- }
68
-
69
- /// Sets the box shadow of the element.
70
- ///
71
- /// @param {String} $box-shadow - The shadow to apply to the element.
72
- @mixin _box-shadow($box-shadow) {
73
- box-shadow: $box-shadow;
74
- }
@@ -1,15 +0,0 @@
1
- //
2
- // Copyright 2021 Google LLC
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
-
6
- $duration: 280ms;
7
- $easing: cubic-bezier(0.4, 0, 0.2, 1);
8
-
9
- @mixin root-static-styles() {
10
- position: relative;
11
- transition: border #{$duration} #{$easing}, box-shadow #{$duration} #{$easing};
12
- // used for interacting with overlays
13
- z-index: 0;
14
- --mdc-ripple-z-index: -1;
15
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { css } from 'lit';
7
- export const styles = css `.md3-elevation-overlay{position:absolute;inset:0;border-radius:inherit;pointer-events:none;transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-2}/*# sourceMappingURL=elevation-overlay-styles.css.map */
8
- `;
9
- //# sourceMappingURL=elevation-overlay-styles.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elevation-overlay-styles.css.js","sourceRoot":"","sources":["elevation-overlay-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`.md3-elevation-overlay{position:absolute;inset:0;border-radius:inherit;pointer-events:none;transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-2}/*# sourceMappingURL=elevation-overlay-styles.css.map */\n`;\n "]}
@@ -1,9 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- @use './elevation-overlay';
8
-
9
- @include elevation-overlay.static-styles;
@@ -1,377 +0,0 @@
1
- //
2
- // Copyright 2022 Google LLC
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
-
6
- // stylelint-disable selector-class-pattern --
7
- // Selector '.md3-*' should only be used in this project.
8
-
9
- @use 'sass:map';
10
- @use 'sass:selector';
11
-
12
- @use '../../ripple/ripple';
13
- @use '../../sass/theme';
14
- @use '../../tokens';
15
-
16
- $light-theme: tokens.md-comp-radio-button-values();
17
- $custom-property-prefix: 'radio';
18
-
19
- @mixin theme($theme) {
20
- $theme: theme.validate-theme($light-theme, $theme);
21
- @include theme.emit-theme-vars(
22
- theme.create-theme-vars($theme, $custom-property-prefix)
23
- );
24
- }
25
-
26
- @mixin theme-styles($theme) {
27
- $theme: theme.validate-theme($light-theme, $theme);
28
- // Set touch target manually until tokens provide this information.
29
- $theme: map.set($theme, _touch-target-size, 48px);
30
- $theme: theme.create-theme-vars($theme, $prefix: $custom-property-prefix);
31
-
32
- .md3-radio {
33
- @include _disabled-selected-icon-color(
34
- map.get($theme, disabled-selected-icon-color)
35
- );
36
- @include _disabled-selected-icon-opacity(
37
- map.get($theme, disabled-selected-icon-opacity)
38
- );
39
- @include _disabled-unselected-icon-color(
40
- map.get($theme, disabled-unselected-icon-color)
41
- );
42
- @include _disabled-unselected-icon-opacity(
43
- map.get($theme, disabled-unselected-icon-opacity)
44
- );
45
- @include _icon-size(map.get($theme, icon-size));
46
- @include _selected-focus-icon-color(
47
- map.get($theme, selected-focus-icon-color)
48
- );
49
- @include _selected-hover-icon-color(
50
- map.get($theme, selected-hover-icon-color)
51
- );
52
- @include _selected-icon-color(map.get($theme, selected-icon-color));
53
- @include _selected-pressed-icon-color(
54
- map.get($theme, selected-pressed-icon-color)
55
- );
56
- @include _state-layer-size(map.get($theme, state-layer-size));
57
- @include _touch-target($size: map.get($theme, state-layer-size));
58
- @include _unselected-focus-icon-color(
59
- map.get($theme, unselected-focus-icon-color)
60
- );
61
- @include _unselected-hover-icon-color(
62
- map.get($theme, unselected-hover-icon-color)
63
- );
64
- @include _unselected-icon-color(map.get($theme, unselected-icon-color));
65
- @include _unselected-pressed-icon-color(
66
- map.get($theme, unselected-pressed-icon-color)
67
- );
68
- }
69
-
70
- .md3-radio--touch {
71
- @include _touch-target($size: map.get($theme, _touch-target-size));
72
- }
73
-
74
- @include ripple.theme(
75
- (
76
- hover-state-layer-color:
77
- map.get($theme, unselected-hover-state-layer-color),
78
- focus-state-layer-color:
79
- map.get($theme, unselected-focus-state-layer-color),
80
- pressed-state-layer-color:
81
- map.get($theme, unselected-pressed-state-layer-color),
82
- hover-state-layer-opacity:
83
- map.get($theme, unselected-hover-state-layer-opacity),
84
- focus-state-layer-opacity:
85
- map.get($theme, unselected-focus-state-layer-opacity),
86
- pressed-state-layer-opacity:
87
- map.get($theme, unselected-pressed-state-layer-opacity),
88
- )
89
- );
90
-
91
- @include _checked-selector() {
92
- @include ripple.theme(
93
- (
94
- hover-state-layer-color:
95
- map.get($theme, selected-hover-state-layer-color),
96
- focus-state-layer-color:
97
- map.get($theme, selected-focus-state-layer-color),
98
- pressed-state-layer-color:
99
- map.get($theme, selected-pressed-state-layer-color),
100
- hover-state-layer-opacity:
101
- map.get($theme, selected-hover-state-layer-opacity),
102
- focus-state-layer-opacity:
103
- map.get($theme, selected-focus-state-layer-opacity),
104
- pressed-state-layer-opacity:
105
- map.get($theme, selected-pressed-state-layer-opacity),
106
- )
107
- );
108
- }
109
- }
110
-
111
- $_theme-extension-keys: (
112
- touch-target-size: null,
113
- );
114
-
115
- @mixin theme-extension($theme) {
116
- $theme: theme.validate-theme($_theme-extension-keys, $theme);
117
-
118
- .md3-radio {
119
- @include _touch-target(map.get($theme, touch-target-size));
120
- }
121
- }
122
-
123
- @mixin high-contrast-styles() {
124
- @include _disabled-selected-icon-color(GrayText);
125
- @include _disabled-selected-icon-opacity(1);
126
- @include _disabled-unselected-icon-color(GrayText);
127
- @include _disabled-unselected-icon-opacity(1);
128
- @include _selected-icon-color(CanvasText);
129
- @include _selected-hover-icon-color(CanvasText);
130
- @include _selected-focus-icon-color(CanvasText);
131
- @include _selected-pressed-icon-color(CanvasText);
132
- @include _unselected-icon-color(CanvasText);
133
- @include _unselected-hover-icon-color(CanvasText);
134
- @include _unselected-focus-icon-color(CanvasText);
135
- @include _unselected-pressed-icon-color(CanvasText);
136
- }
137
-
138
- ///
139
- /// Sets the stroke color of a checked, disabled radio button.
140
- /// @param {Color} $color - The desired stroke color.
141
- ///
142
- @mixin disabled-checked-stroke-color($color) {
143
- @include _if-disabled-checked {
144
- @include _stroke-color($color);
145
- }
146
- }
147
-
148
- ///
149
- /// Sets the stroke color of an unchecked, disabled radio button.
150
- /// @param {Color} $color - The desired stroke color.
151
- ///
152
- @mixin disabled-unchecked-stroke-color($color) {
153
- @include _if-disabled-unchecked {
154
- @include _stroke-color($color);
155
- }
156
- }
157
-
158
- ///
159
- /// Sets the ink color of a disabled radio button.
160
- /// @param {Color} $color - The desired ink color
161
- ///
162
- @mixin disabled-ink-color($color) {
163
- @include _if-disabled {
164
- @include _ink-color($color);
165
- }
166
- }
167
-
168
- @mixin _disabled-selected-icon-color($color) {
169
- @include disabled-checked-stroke-color($color);
170
- @include disabled-ink-color($color);
171
- }
172
-
173
- @mixin _disabled-selected-icon-opacity($opacity) {
174
- @include _disabled-checked-stroke-opacity($opacity);
175
- @include _disabled-ink-opacity($opacity);
176
- }
177
-
178
- @mixin _disabled-unselected-icon-color($color) {
179
- @include disabled-unchecked-stroke-color($color);
180
- }
181
-
182
- @mixin _disabled-unselected-icon-opacity($opacity) {
183
- @include _disabled-unchecked-stroke-opacity($opacity);
184
- }
185
-
186
- @mixin _icon-size($size) {
187
- .md3-radio__background {
188
- height: $size;
189
- width: $size;
190
- }
191
- }
192
-
193
- @mixin _selected-hover-icon-color($color) {
194
- @include _if-input-selected {
195
- &:hover + {
196
- @include _stroke-color($color);
197
- @include _ink-color($color);
198
- }
199
- }
200
- }
201
-
202
- @mixin _selected-focus-icon-color($color) {
203
- @include _if-input-selected {
204
- &:focus + {
205
- @include _stroke-color($color);
206
- @include _ink-color($color);
207
- }
208
- }
209
- }
210
-
211
- @mixin _selected-pressed-icon-color($color) {
212
- @include _if-input-selected {
213
- &:active + {
214
- @include _stroke-color($color);
215
- @include _ink-color($color);
216
- }
217
- }
218
- }
219
-
220
- @mixin _selected-icon-color($color) {
221
- @include _if-input-selected {
222
- & + {
223
- @include _stroke-color($color);
224
- @include _ink-color($color);
225
- }
226
- }
227
- }
228
-
229
- @mixin _unselected-hover-icon-color($color) {
230
- @include _if-input-unselected {
231
- &:hover + {
232
- @include _stroke-color($color);
233
- }
234
- }
235
- }
236
-
237
- @mixin _unselected-focus-icon-color($color) {
238
- @include _if-input-unselected {
239
- &:focus + {
240
- @include _stroke-color($color);
241
- }
242
- }
243
- }
244
-
245
- @mixin _unselected-pressed-icon-color($color) {
246
- @include _if-input-unselected {
247
- &:active + {
248
- @include _stroke-color($color);
249
- }
250
- }
251
- }
252
-
253
- @mixin _unselected-icon-color($color) {
254
- @include _if-input-unselected {
255
- & + {
256
- @include _stroke-color($color);
257
- }
258
- }
259
- }
260
-
261
- @mixin _disabled-unchecked-stroke-opacity($opacity) {
262
- @include _if-disabled-unchecked {
263
- @include _stroke-opacity($opacity);
264
- }
265
- }
266
-
267
- @mixin _disabled-checked-stroke-opacity($opacity) {
268
- @include _if-disabled-checked {
269
- @include _stroke-opacity($opacity);
270
- }
271
- }
272
-
273
- @mixin _disabled-ink-opacity($opacity) {
274
- @include _if-disabled {
275
- @include _ink-opacity($opacity);
276
- }
277
- }
278
-
279
- @mixin _touch-target($size) {
280
- block-size: $size;
281
- inline-size: $size;
282
- }
283
-
284
- @mixin _state-layer-size($size) {
285
- .md3-radio__ripple {
286
- block-size: $size;
287
- inline-size: $size;
288
- }
289
- }
290
-
291
- ///
292
- /// Sets the ink color for radio. This is wrapped in a mixin
293
- /// that qualifies state such as `_if-enabled`
294
- ///
295
- @mixin _ink-color($color) {
296
- .md3-radio__background .md3-radio__inner-circle {
297
- background-color: $color;
298
- }
299
- }
300
-
301
- @mixin _ink-opacity($opacity) {
302
- .md3-radio__background .md3-radio__inner-circle {
303
- opacity: $opacity;
304
- }
305
- }
306
-
307
- ///
308
- /// Sets the stroke color for radio. This is wrapped in a mixin
309
- /// that qualifies state such as `_if-enabled`
310
- ///
311
- @mixin _stroke-color($color) {
312
- .md3-radio__background .md3-radio__outer-circle {
313
- border-color: $color;
314
- }
315
- }
316
-
317
- @mixin _stroke-opacity($opacity) {
318
- .md3-radio__background .md3-radio__outer-circle {
319
- opacity: $opacity;
320
- }
321
- }
322
-
323
- @mixin _checked-selector() {
324
- @at-root {
325
- :host([checked]) {
326
- @content;
327
- }
328
- }
329
- }
330
-
331
- @mixin _if-input-unselected {
332
- .md3-radio__native-control:enabled:not(:checked) {
333
- @content;
334
- }
335
- }
336
-
337
- @mixin _if-input-selected {
338
- .md3-radio__native-control:enabled:checked {
339
- @content;
340
- }
341
- }
342
-
343
- ///
344
- /// Helps select the radio background only when its native control is in the
345
- /// disabled state.
346
- ///
347
- @mixin _if-disabled {
348
- .md3-radio__native-control:disabled {
349
- + {
350
- @content;
351
- }
352
- }
353
- }
354
-
355
- ///
356
- /// Helps select the radio background only when its native control is in the
357
- /// disabled & unchecked state.
358
- ///
359
- @mixin _if-disabled-unchecked {
360
- .md3-radio__native-control:disabled {
361
- &:not(:checked) + {
362
- @content;
363
- }
364
- }
365
- }
366
-
367
- ///
368
- /// Helps select the radio background only when its native control is in the
369
- /// disabled & checked state.
370
- ///
371
- @mixin _if-disabled-checked {
372
- .md3-radio__native-control:disabled {
373
- &:checked + {
374
- @content;
375
- }
376
- }
377
- }