@angular/material 17.0.0-rc.1 → 17.0.0-rc.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 (251) hide show
  1. package/button/_button-base.scss +37 -18
  2. package/button/_button-theme.scss +86 -142
  3. package/button/_fab-theme.scss +21 -49
  4. package/button/_icon-button-theme.scss +25 -25
  5. package/core/_core-theme.scss +4 -4
  6. package/core/ripple/_ripple-theme.scss +27 -17
  7. package/core/ripple/_ripple.scss +8 -0
  8. package/core/theming/_theming.scss +0 -14
  9. package/core/tokens/m2/mat/_fab.scss +87 -0
  10. package/core/tokens/m2/mat/_filled-button.scss +76 -0
  11. package/core/tokens/m2/mat/_icon-button.scss +73 -0
  12. package/core/tokens/m2/mat/_outlined-button.scss +73 -0
  13. package/core/tokens/m2/mat/_protected-button.scss +76 -0
  14. package/core/tokens/m2/mat/_ripple.scss +49 -0
  15. package/core/tokens/m2/mat/_text-button.scss +73 -0
  16. package/core/tokens/m2/mdc/_extended-fab.scss +3 -0
  17. package/core/tokens/m2/mdc/_fab.scss +17 -3
  18. package/core/tokens/m2/mdc/_filled-button.scss +24 -18
  19. package/core/tokens/m2/mdc/_icon-button.scss +0 -3
  20. package/core/tokens/m2/mdc/_outlined-button.scss +120 -0
  21. package/core/tokens/m2/mdc/_protected-button.scss +24 -19
  22. package/dialog/index.d.ts +2 -1
  23. package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
  24. package/esm2022/autocomplete/autocomplete-trigger.mjs +3 -3
  25. package/esm2022/autocomplete/autocomplete.mjs +3 -3
  26. package/esm2022/autocomplete/module.mjs +4 -4
  27. package/esm2022/badge/badge-module.mjs +4 -4
  28. package/esm2022/badge/badge.mjs +3 -3
  29. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  30. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +4 -4
  31. package/esm2022/bottom-sheet/bottom-sheet.mjs +3 -3
  32. package/esm2022/button/button-base.mjs +6 -6
  33. package/esm2022/button/button.mjs +8 -8
  34. package/esm2022/button/fab.mjs +16 -16
  35. package/esm2022/button/icon-button.mjs +8 -8
  36. package/esm2022/button/module.mjs +4 -4
  37. package/esm2022/button-toggle/button-toggle-module.mjs +4 -4
  38. package/esm2022/button-toggle/button-toggle.mjs +6 -6
  39. package/esm2022/card/card.mjs +42 -42
  40. package/esm2022/card/module.mjs +4 -4
  41. package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
  42. package/esm2022/checkbox/checkbox.mjs +3 -3
  43. package/esm2022/checkbox/module.mjs +8 -8
  44. package/esm2022/chips/chip-action.mjs +3 -3
  45. package/esm2022/chips/chip-edit-input.mjs +3 -3
  46. package/esm2022/chips/chip-grid.mjs +3 -3
  47. package/esm2022/chips/chip-icons.mjs +9 -9
  48. package/esm2022/chips/chip-input.mjs +3 -3
  49. package/esm2022/chips/chip-listbox.mjs +3 -3
  50. package/esm2022/chips/chip-option.mjs +3 -3
  51. package/esm2022/chips/chip-row.mjs +3 -3
  52. package/esm2022/chips/chip-set.mjs +3 -3
  53. package/esm2022/chips/chip.mjs +3 -3
  54. package/esm2022/chips/module.mjs +4 -4
  55. package/esm2022/core/common-behaviors/common-module.mjs +4 -4
  56. package/esm2022/core/datetime/index.mjs +8 -8
  57. package/esm2022/core/datetime/native-date-adapter.mjs +3 -3
  58. package/esm2022/core/error/error-options.mjs +6 -6
  59. package/esm2022/core/line/line.mjs +7 -7
  60. package/esm2022/core/option/index.mjs +4 -4
  61. package/esm2022/core/option/optgroup.mjs +3 -3
  62. package/esm2022/core/option/option.mjs +3 -3
  63. package/esm2022/core/private/ripple-loader.mjs +3 -3
  64. package/esm2022/core/ripple/index.mjs +4 -4
  65. package/esm2022/core/ripple/ripple.mjs +3 -3
  66. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
  67. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
  68. package/esm2022/core/version.mjs +1 -1
  69. package/esm2022/datepicker/calendar-body.mjs +3 -3
  70. package/esm2022/datepicker/calendar.mjs +6 -6
  71. package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
  72. package/esm2022/datepicker/date-range-input.mjs +3 -3
  73. package/esm2022/datepicker/date-range-picker.mjs +3 -3
  74. package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
  75. package/esm2022/datepicker/date-selection-model.mjs +9 -9
  76. package/esm2022/datepicker/datepicker-actions.mjs +9 -9
  77. package/esm2022/datepicker/datepicker-base.mjs +6 -6
  78. package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
  79. package/esm2022/datepicker/datepicker-input.mjs +3 -3
  80. package/esm2022/datepicker/datepicker-intl.mjs +3 -3
  81. package/esm2022/datepicker/datepicker-module.mjs +4 -4
  82. package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
  83. package/esm2022/datepicker/datepicker.mjs +3 -3
  84. package/esm2022/datepicker/month-view.mjs +3 -3
  85. package/esm2022/datepicker/multi-year-view.mjs +3 -3
  86. package/esm2022/datepicker/year-view.mjs +3 -3
  87. package/esm2022/dialog/dialog-container.mjs +3 -3
  88. package/esm2022/dialog/dialog-content-directives.mjs +12 -12
  89. package/esm2022/dialog/dialog.mjs +4 -4
  90. package/esm2022/dialog/module.mjs +4 -4
  91. package/esm2022/divider/divider-module.mjs +4 -4
  92. package/esm2022/divider/divider.mjs +3 -3
  93. package/esm2022/expansion/accordion.mjs +3 -3
  94. package/esm2022/expansion/expansion-module.mjs +4 -4
  95. package/esm2022/expansion/expansion-panel-content.mjs +3 -3
  96. package/esm2022/expansion/expansion-panel-header.mjs +9 -9
  97. package/esm2022/expansion/expansion-panel.mjs +6 -6
  98. package/esm2022/form-field/directives/error.mjs +3 -3
  99. package/esm2022/form-field/directives/floating-label.mjs +3 -3
  100. package/esm2022/form-field/directives/hint.mjs +3 -3
  101. package/esm2022/form-field/directives/label.mjs +3 -3
  102. package/esm2022/form-field/directives/line-ripple.mjs +3 -3
  103. package/esm2022/form-field/directives/notched-outline.mjs +3 -3
  104. package/esm2022/form-field/directives/prefix.mjs +3 -3
  105. package/esm2022/form-field/directives/suffix.mjs +3 -3
  106. package/esm2022/form-field/form-field-control.mjs +3 -3
  107. package/esm2022/form-field/form-field.mjs +3 -3
  108. package/esm2022/form-field/module.mjs +4 -4
  109. package/esm2022/grid-list/grid-list-module.mjs +4 -4
  110. package/esm2022/grid-list/grid-list.mjs +3 -3
  111. package/esm2022/grid-list/grid-tile.mjs +15 -15
  112. package/esm2022/icon/icon-module.mjs +4 -4
  113. package/esm2022/icon/icon-registry.mjs +3 -3
  114. package/esm2022/icon/icon.mjs +3 -3
  115. package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
  116. package/esm2022/input/input.mjs +3 -3
  117. package/esm2022/input/module.mjs +4 -4
  118. package/esm2022/list/action-list.mjs +3 -3
  119. package/esm2022/list/list-base.mjs +6 -6
  120. package/esm2022/list/list-item-sections.mjs +18 -18
  121. package/esm2022/list/list-module.mjs +4 -4
  122. package/esm2022/list/list-option.mjs +3 -3
  123. package/esm2022/list/list.mjs +6 -6
  124. package/esm2022/list/nav-list.mjs +3 -3
  125. package/esm2022/list/selection-list.mjs +3 -3
  126. package/esm2022/list/subheader.mjs +3 -3
  127. package/esm2022/menu/menu-content.mjs +3 -3
  128. package/esm2022/menu/menu-item.mjs +3 -3
  129. package/esm2022/menu/menu-trigger.mjs +3 -3
  130. package/esm2022/menu/menu.mjs +3 -3
  131. package/esm2022/menu/module.mjs +4 -4
  132. package/esm2022/paginator/module.mjs +4 -4
  133. package/esm2022/paginator/paginator-intl.mjs +3 -3
  134. package/esm2022/paginator/paginator.mjs +3 -3
  135. package/esm2022/progress-bar/module.mjs +4 -4
  136. package/esm2022/progress-bar/progress-bar.mjs +3 -3
  137. package/esm2022/progress-spinner/module.mjs +4 -4
  138. package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
  139. package/esm2022/radio/module.mjs +4 -4
  140. package/esm2022/radio/radio.mjs +6 -6
  141. package/esm2022/select/module.mjs +4 -4
  142. package/esm2022/select/select.mjs +6 -6
  143. package/esm2022/sidenav/drawer.mjs +9 -9
  144. package/esm2022/sidenav/sidenav-module.mjs +4 -4
  145. package/esm2022/sidenav/sidenav.mjs +9 -9
  146. package/esm2022/slide-toggle/module.mjs +8 -8
  147. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
  148. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  149. package/esm2022/slider/module.mjs +4 -4
  150. package/esm2022/slider/slider-input.mjs +6 -6
  151. package/esm2022/slider/slider-thumb.mjs +3 -3
  152. package/esm2022/slider/slider.mjs +3 -3
  153. package/esm2022/snack-bar/module.mjs +4 -4
  154. package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
  155. package/esm2022/snack-bar/snack-bar-container.mjs +5 -5
  156. package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
  157. package/esm2022/snack-bar/snack-bar.mjs +3 -3
  158. package/esm2022/sort/sort-header-intl.mjs +3 -3
  159. package/esm2022/sort/sort-header.mjs +3 -3
  160. package/esm2022/sort/sort-module.mjs +4 -4
  161. package/esm2022/sort/sort.mjs +3 -3
  162. package/esm2022/stepper/step-content.mjs +3 -3
  163. package/esm2022/stepper/step-header.mjs +3 -3
  164. package/esm2022/stepper/step-label.mjs +3 -3
  165. package/esm2022/stepper/stepper-button.mjs +6 -6
  166. package/esm2022/stepper/stepper-icon.mjs +3 -3
  167. package/esm2022/stepper/stepper-intl.mjs +3 -3
  168. package/esm2022/stepper/stepper-module.mjs +4 -4
  169. package/esm2022/stepper/stepper.mjs +6 -6
  170. package/esm2022/table/cell.mjs +21 -21
  171. package/esm2022/table/module.mjs +4 -4
  172. package/esm2022/table/row.mjs +21 -21
  173. package/esm2022/table/table.mjs +6 -6
  174. package/esm2022/table/text-column.mjs +3 -3
  175. package/esm2022/tabs/module.mjs +4 -4
  176. package/esm2022/tabs/paginated-tab-header.mjs +3 -3
  177. package/esm2022/tabs/tab-body.mjs +6 -6
  178. package/esm2022/tabs/tab-content.mjs +3 -3
  179. package/esm2022/tabs/tab-group.mjs +3 -3
  180. package/esm2022/tabs/tab-header.mjs +3 -3
  181. package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
  182. package/esm2022/tabs/tab-label.mjs +3 -3
  183. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +9 -9
  184. package/esm2022/tabs/tab.mjs +3 -3
  185. package/esm2022/toolbar/toolbar-module.mjs +4 -4
  186. package/esm2022/toolbar/toolbar.mjs +6 -6
  187. package/esm2022/tooltip/module.mjs +4 -4
  188. package/esm2022/tooltip/tooltip.mjs +6 -6
  189. package/esm2022/tree/node.mjs +9 -9
  190. package/esm2022/tree/outlet.mjs +3 -3
  191. package/esm2022/tree/padding.mjs +3 -3
  192. package/esm2022/tree/toggle.mjs +3 -3
  193. package/esm2022/tree/tree-module.mjs +4 -4
  194. package/esm2022/tree/tree.mjs +3 -3
  195. package/fesm2022/autocomplete.mjs +13 -13
  196. package/fesm2022/badge.mjs +7 -7
  197. package/fesm2022/bottom-sheet.mjs +10 -10
  198. package/fesm2022/button-toggle.mjs +10 -10
  199. package/fesm2022/button.mjs +42 -42
  200. package/fesm2022/button.mjs.map +1 -1
  201. package/fesm2022/card.mjs +46 -46
  202. package/fesm2022/checkbox.mjs +14 -14
  203. package/fesm2022/chips.mjs +40 -40
  204. package/fesm2022/core.mjs +56 -56
  205. package/fesm2022/core.mjs.map +1 -1
  206. package/fesm2022/datepicker.mjs +82 -82
  207. package/fesm2022/dialog.mjs +22 -22
  208. package/fesm2022/dialog.mjs.map +1 -1
  209. package/fesm2022/divider.mjs +7 -7
  210. package/fesm2022/expansion.mjs +25 -25
  211. package/fesm2022/form-field.mjs +34 -34
  212. package/fesm2022/grid-list.mjs +22 -22
  213. package/fesm2022/icon/testing.mjs +7 -7
  214. package/fesm2022/icon.mjs +10 -10
  215. package/fesm2022/input.mjs +7 -7
  216. package/fesm2022/list.mjs +49 -49
  217. package/fesm2022/menu.mjs +16 -16
  218. package/fesm2022/paginator.mjs +10 -10
  219. package/fesm2022/progress-bar.mjs +7 -7
  220. package/fesm2022/progress-spinner.mjs +7 -7
  221. package/fesm2022/radio.mjs +10 -10
  222. package/fesm2022/select.mjs +10 -10
  223. package/fesm2022/sidenav.mjs +22 -22
  224. package/fesm2022/slide-toggle.mjs +14 -14
  225. package/fesm2022/slider.mjs +16 -16
  226. package/fesm2022/snack-bar.mjs +23 -23
  227. package/fesm2022/snack-bar.mjs.map +1 -1
  228. package/fesm2022/sort.mjs +13 -13
  229. package/fesm2022/stepper.mjs +31 -31
  230. package/fesm2022/table.mjs +55 -55
  231. package/fesm2022/tabs.mjs +40 -40
  232. package/fesm2022/toolbar.mjs +10 -10
  233. package/fesm2022/tooltip.mjs +10 -10
  234. package/fesm2022/tree.mjs +25 -25
  235. package/package.json +2 -2
  236. package/prebuilt-themes/deeppurple-amber.css +1 -1
  237. package/prebuilt-themes/indigo-pink.css +1 -1
  238. package/prebuilt-themes/pink-bluegrey.css +1 -1
  239. package/prebuilt-themes/purple-green.css +1 -1
  240. package/schematics/migration.json +1 -1
  241. package/schematics/ng-add/fonts/material-fonts.js +1 -3
  242. package/schematics/ng-add/fonts/material-fonts.mjs +1 -3
  243. package/schematics/ng-add/index.js +1 -1
  244. package/schematics/ng-add/index.mjs +1 -1
  245. package/schematics/ng-generate/mdc-migration/index_bundled.js +1664 -936
  246. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  247. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +4 -1
  248. package/schematics/ng-update/index_bundled.js +123 -30
  249. package/schematics/ng-update/index_bundled.js.map +4 -4
  250. package/button/_button-theme-private.scss +0 -67
  251. package/core/density/private/_compatibility.scss +0 -74
@@ -1,26 +1,30 @@
1
- @use 'sass:meta';
1
+ @use '../tokens/m2/mat/ripple' as tokens-mat-ripple;
2
+ @use '../tokens/token-utils';
3
+ @use '../style/sass-utils';
4
+
2
5
  @use '../theming/theming';
3
6
  @use '../theming/inspection';
4
7
 
5
- @mixin base($theme) {
6
- // TODO(mmalerba): Move ripple base tokens here
7
- }
8
+ @mixin base($theme) {}
8
9
 
9
- // Colors for the ripple elements.
10
10
  @mixin color($theme) {
11
- $foreground-base: inspection.get-theme-color($theme, foreground, base);
12
- $color-opacity: 0.1;
11
+ @include sass-utils.current-selector-or-root() {
12
+ @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
13
+ tokens-mat-ripple.get-color-tokens($theme));
14
+ }
15
+ }
13
16
 
14
- .mat-ripple-element {
15
- // If the ripple color is resolves to a color *type*, we can use it directly, otherwise
16
- // (e.g. it resolves to a CSS variable) we fall back to using the color and setting an opacity.
17
- @if (meta.type-of($foreground-base) == color) {
18
- background-color: rgba($foreground-base, $color-opacity);
19
- }
20
- @else {
21
- background-color: $foreground-base;
22
- opacity: $color-opacity;
23
- }
17
+ @mixin typography($theme) {
18
+ @include sass-utils.current-selector-or-root() {
19
+ @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
20
+ tokens-mat-ripple.get-typography-tokens($theme));
21
+ }
22
+ }
23
+
24
+ @mixin density($theme) {
25
+ @include sass-utils.current-selector-or-root() {
26
+ @include token-utils.create-token-values(tokens-mat-ripple.$prefix,
27
+ tokens-mat-ripple.get-density-tokens($theme));
24
28
  }
25
29
  }
26
30
 
@@ -30,5 +34,11 @@
30
34
  @if inspection.theme-has($theme, color) {
31
35
  @include color($theme);
32
36
  }
37
+ @if inspection.theme-has($theme, density) {
38
+ @include density($theme);
39
+ }
40
+ @if inspection.theme-has($theme, typography) {
41
+ @include typography($theme);
42
+ }
33
43
  }
34
44
  }
@@ -1,4 +1,6 @@
1
1
  @use '@angular/cdk';
2
+ @use '../tokens/m2/mat/ripple' as tokens-mat-ripple;
3
+ @use '../tokens/token-utils';
2
4
 
3
5
  @mixin ripple() {
4
6
  // The host element of an mat-ripple directive should always have a position of "absolute" or
@@ -35,6 +37,12 @@
35
37
  // the ripples aren't clipped when inside the shadow DOM (see #24028).
36
38
  transform: scale3d(0, 0, 0);
37
39
 
40
+ @include token-utils.use-tokens(
41
+ tokens-mat-ripple.$prefix, tokens-mat-ripple.get-token-slots()) {
42
+ // We have to emit a fallback value here, because some internal builds depend on it.
43
+ background-color: var(#{token-utils.get-token-variable(color)}, rgba(#000, 0.1));
44
+ }
45
+
38
46
  // In high contrast mode the ripple is opaque, causing it to obstruct the content.
39
47
  @include cdk.high-contrast(active, off) {
40
48
  display: none;
@@ -3,7 +3,6 @@
3
3
  @use 'sass:math';
4
4
  @use 'sass:meta';
5
5
  @use 'palette';
6
- @use '../density/private/compatibility';
7
6
 
8
7
  // Whether to enable compatibility with legacy methods for accessing theme information.
9
8
  $theme-legacy-inspection-api-compatibility: true !default;
@@ -481,20 +480,7 @@ $_internals: _mat-theming-internals-do-not-access;
481
480
  $_emitted-density: map.merge($_emitted-density, ($id: $previous-density)) !global;
482
481
  $_emitted-typography: map.merge($_emitted-typography, ($id: $previous-typography)) !global;
483
482
 
484
- // If duplicate default density styles would be generated for a legacy constructed theme,
485
- // we adjust the density generation so that no density styles are generated by default.
486
- // If no default density styles have been generated yet, we ensure that the styles
487
- // are generated at root. For legacy themes our goal is to generate default density
488
- // styles **once** and at root. This matches the old behavior where density styles were
489
- // part of the base component styles (that did not use view encapsulation).
490
- // TODO: Remove this compatibility logic when the legacy theming API is removed.
491
- compatibility.$private-density-generate-at-root: private-is-legacy-constructed-theme($theme);
492
- compatibility.$private-density-generate-styles: not $duplicate-legacy-density;
493
-
494
483
  @content;
495
-
496
- compatibility.$private-density-generate-at-root: false;
497
- compatibility.$private-density-generate-styles: true;
498
484
  }
499
485
 
500
486
  // Checks whether the given value resolves to a theme object. Theme objects are always
@@ -0,0 +1,87 @@
1
+ @use 'sass:map';
2
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
+ @use '../../token-utils';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../style/sass-utils';
6
+ @use '../../../mdc-helpers/mdc-helpers';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, fab);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of icons and text projected into a FAB.
28
+ foreground-color: inspection.get-theme-color($theme, foreground, base),
29
+
30
+ // Color of the element that shows the hover, focus and pressed states.
31
+ state-layer-color: $on-surface,
32
+
33
+ // Color of the ripple element.
34
+ ripple-color: rgba($on-surface, 0.1),
35
+
36
+ // Opacity of the ripple when the button is hovered.
37
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
38
+
39
+ // Opacity of the ripple when the button is focused.
40
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
41
+
42
+ // Opacity of the ripple when the button is pressed.
43
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
44
+
45
+ // MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
46
+ // Background color of the container when the FAB is disabled.
47
+ disabled-state-container-color: rgba($on-surface, 0.12),
48
+
49
+ // Color of the icons and projected text when the FAB is disabled.
50
+ disabled-state-foreground-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
51
+ );
52
+ }
53
+
54
+ // Generates the mapping for the properties that change based on the FAB palette color.
55
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
56
+ $is-dark: inspection.get-theme-type($theme) == dark;
57
+ $container-color: inspection.get-theme-color($theme, $palette-name);
58
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
59
+ $color: if($contrast-tone == 'dark', #000, #fff);
60
+
61
+ @return (
62
+ foreground-color: $color,
63
+ state-layer-color: $color,
64
+ ripple-color: rgba($color, 0.1),
65
+ );
66
+ }
67
+
68
+ // Tokens that can be configured through Angular Material's typography theming API.
69
+ @function get-typography-tokens($theme) {
70
+ @return ();
71
+ }
72
+
73
+ // Tokens that can be configured through Angular Material's density theming API.
74
+ @function get-density-tokens($theme) {
75
+ @return ();
76
+ }
77
+
78
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
79
+ // This is used to create token slots.
80
+ @function get-token-slots() {
81
+ @return sass-utils.deep-merge-all(
82
+ get-unthemable-tokens(),
83
+ get-color-tokens(token-utils.$placeholder-color-config),
84
+ get-typography-tokens(token-utils.$placeholder-typography-config),
85
+ get-density-tokens(token-utils.$placeholder-density-config)
86
+ );
87
+ }
@@ -0,0 +1,76 @@
1
+ @use 'sass:map';
2
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
+ @use '../../token-utils';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../style/sass-utils';
6
+ @use '../../../mdc-helpers/mdc-helpers';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, filled-button);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of the element that shows the hover, focus and pressed states.
28
+ state-layer-color: $on-surface,
29
+
30
+ // Color of the ripple element.
31
+ ripple-color: rgba($on-surface, 0.1),
32
+
33
+ // Opacity of the ripple when the button is hovered.
34
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+
36
+ // Opacity of the ripple when the button is focused.
37
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+
39
+ // Opacity of the ripple when the button is pressed.
40
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ );
42
+ }
43
+
44
+ // Generates the mapping for the properties that change based on the button palette color.
45
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
46
+ $is-dark: inspection.get-theme-type($theme) == dark;
47
+ $container-color: inspection.get-theme-color($theme, $palette-name);
48
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
49
+ $color: if($contrast-tone == 'dark', #000, #fff);
50
+
51
+ @return (
52
+ state-layer-color: $color,
53
+ ripple-color: rgba($color, 0.1),
54
+ );
55
+ }
56
+
57
+ // Tokens that can be configured through Angular Material's typography theming API.
58
+ @function get-typography-tokens($theme) {
59
+ @return ();
60
+ }
61
+
62
+ // Tokens that can be configured through Angular Material's density theming API.
63
+ @function get-density-tokens($theme) {
64
+ @return ();
65
+ }
66
+
67
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
68
+ // This is used to create token slots.
69
+ @function get-token-slots() {
70
+ @return sass-utils.deep-merge-all(
71
+ get-unthemable-tokens(),
72
+ get-color-tokens(token-utils.$placeholder-color-config),
73
+ get-typography-tokens(token-utils.$placeholder-typography-config),
74
+ get-density-tokens(token-utils.$placeholder-density-config)
75
+ );
76
+ }
@@ -0,0 +1,73 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
+ @use '../../token-utils';
5
+ @use '../../../theming/inspection';
6
+ @use '../../../style/sass-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, icon-button);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of the element that shows the hover, focus and pressed states.
28
+ state-layer-color: $on-surface,
29
+
30
+ // Color of the ripple element.
31
+ ripple-color: rgba($on-surface, 0.1),
32
+
33
+ // Opacity of the ripple when the button is hovered.
34
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+
36
+ // Opacity of the ripple when the button is focused.
37
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+
39
+ // Opacity of the ripple when the button is pressed.
40
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ );
42
+ }
43
+
44
+ // Generates the mapping for the properties that change based on the button palette color.
45
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
46
+ $color: inspection.get-theme-color($theme, $palette-name);
47
+
48
+ @return (
49
+ state-layer-color: $color,
50
+ ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
51
+ );
52
+ }
53
+
54
+ // Tokens that can be configured through Angular Material's typography theming API.
55
+ @function get-typography-tokens($theme) {
56
+ @return ();
57
+ }
58
+
59
+ // Tokens that can be configured through Angular Material's density theming API.
60
+ @function get-density-tokens($theme) {
61
+ @return ();
62
+ }
63
+
64
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
65
+ // This is used to create token slots.
66
+ @function get-token-slots() {
67
+ @return sass-utils.deep-merge-all(
68
+ get-unthemable-tokens(),
69
+ get-color-tokens(token-utils.$placeholder-color-config),
70
+ get-typography-tokens(token-utils.$placeholder-typography-config),
71
+ get-density-tokens(token-utils.$placeholder-density-config)
72
+ );
73
+ }
@@ -0,0 +1,73 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
+ @use '../../token-utils';
5
+ @use '../../../theming/inspection';
6
+ @use '../../../style/sass-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, outlined-button);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of the element that shows the hover, focus and pressed states.
28
+ state-layer-color: $on-surface,
29
+
30
+ // Color of the ripple element.
31
+ ripple-color: rgba($on-surface, 0.1),
32
+
33
+ // Opacity of the ripple when the button is hovered.
34
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+
36
+ // Opacity of the ripple when the button is focused.
37
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+
39
+ // Opacity of the ripple when the button is pressed.
40
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ );
42
+ }
43
+
44
+ // Generates the mapping for the properties that change based on the button palette color.
45
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
46
+ $color: inspection.get-theme-color($theme, $palette-name);
47
+
48
+ @return (
49
+ state-layer-color: $color,
50
+ ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
51
+ );
52
+ }
53
+
54
+ // Tokens that can be configured through Angular Material's typography theming API.
55
+ @function get-typography-tokens($theme) {
56
+ @return ();
57
+ }
58
+
59
+ // Tokens that can be configured through Angular Material's density theming API.
60
+ @function get-density-tokens($theme) {
61
+ @return ();
62
+ }
63
+
64
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
65
+ // This is used to create token slots.
66
+ @function get-token-slots() {
67
+ @return sass-utils.deep-merge-all(
68
+ get-unthemable-tokens(),
69
+ get-color-tokens(token-utils.$placeholder-color-config),
70
+ get-typography-tokens(token-utils.$placeholder-typography-config),
71
+ get-density-tokens(token-utils.$placeholder-density-config)
72
+ );
73
+ }
@@ -0,0 +1,76 @@
1
+ @use 'sass:map';
2
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
3
+ @use '../../token-utils';
4
+ @use '../../../theming/inspection';
5
+ @use '../../../style/sass-utils';
6
+ @use '../../../mdc-helpers/mdc-helpers';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, protected-button);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of the element that shows the hover, focus and pressed states.
28
+ state-layer-color: $on-surface,
29
+
30
+ // Color of the ripple element.
31
+ ripple-color: rgba($on-surface, 0.1),
32
+
33
+ // Opacity of the ripple when the button is hovered.
34
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+
36
+ // Opacity of the ripple when the button is focused.
37
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+
39
+ // Opacity of the ripple when the button is pressed.
40
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ );
42
+ }
43
+
44
+ // Generates the mapping for the properties that change based on the button palette color.
45
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
46
+ $is-dark: inspection.get-theme-type($theme) == dark;
47
+ $container-color: inspection.get-theme-color($theme, $palette-name);
48
+ $contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
49
+ $color: if($contrast-tone == 'dark', #000, #fff);
50
+
51
+ @return (
52
+ state-layer-color: $color,
53
+ ripple-color: rgba($color, 0.1),
54
+ );
55
+ }
56
+
57
+ // Tokens that can be configured through Angular Material's typography theming API.
58
+ @function get-typography-tokens($theme) {
59
+ @return ();
60
+ }
61
+
62
+ // Tokens that can be configured through Angular Material's density theming API.
63
+ @function get-density-tokens($theme) {
64
+ @return ();
65
+ }
66
+
67
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
68
+ // This is used to create token slots.
69
+ @function get-token-slots() {
70
+ @return sass-utils.deep-merge-all(
71
+ get-unthemable-tokens(),
72
+ get-color-tokens(token-utils.$placeholder-color-config),
73
+ get-typography-tokens(token-utils.$placeholder-typography-config),
74
+ get-density-tokens(token-utils.$placeholder-density-config)
75
+ );
76
+ }
@@ -0,0 +1,49 @@
1
+ @use 'sass:meta';
2
+ @use '../../token-utils';
3
+ @use '../../../theming/inspection';
4
+ @use '../../../style/sass-utils';
5
+
6
+ // The prefix used to generate the fully qualified name for tokens in this file.
7
+ $prefix: (mat, ripple);
8
+
9
+ // Tokens that can't be configured through Angular Material's current theming API,
10
+ // but may be in a future version of the theming API.
11
+ @function get-unthemable-tokens() {
12
+ @return ();
13
+ }
14
+
15
+ // Tokens that can be configured through Angular Material's color theming API.
16
+ @function get-color-tokens($theme) {
17
+ $is-dark: inspection.get-theme-type($theme) == dark;
18
+ $base: inspection.get-theme-color($theme, foreground, base);
19
+
20
+ // If the base is a color *type* we can use it directly in the `rgba` call below.
21
+ // If it's anything else (e.g. a CSS variable) we fall back to using static colors
22
+ // since we don't have a way of adjusting the opacity.
23
+ $color: if(meta.type-of($base) == color, $base, if($is-dark, #fff, #000));
24
+
25
+ @return (
26
+ color: rgba($color, 0.1),
27
+ );
28
+ }
29
+
30
+ // Tokens that can be configured through Angular Material's typography theming API.
31
+ @function get-typography-tokens($theme) {
32
+ @return ();
33
+ }
34
+
35
+ // Tokens that can be configured through Angular Material's density theming API.
36
+ @function get-density-tokens($theme) {
37
+ @return ();
38
+ }
39
+
40
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
41
+ // This is used to create token slots.
42
+ @function get-token-slots() {
43
+ @return sass-utils.deep-merge-all(
44
+ get-unthemable-tokens(),
45
+ get-color-tokens(token-utils.$placeholder-color-config),
46
+ get-typography-tokens(token-utils.$placeholder-typography-config),
47
+ get-density-tokens(token-utils.$placeholder-density-config)
48
+ );
49
+ }
@@ -0,0 +1,73 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '@material/ripple/ripple-theme' as mdc-ripple-theme;
4
+ @use '../../token-utils';
5
+ @use '../../../theming/inspection';
6
+ @use '../../../style/sass-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, text-button);
10
+
11
+ // Tokens that can't be configured through Angular Material's current theming API,
12
+ // but may be in a future version of the theming API.
13
+ @function get-unthemable-tokens() {
14
+ @return ();
15
+ }
16
+
17
+ // Tokens that can be configured through Angular Material's color theming API.
18
+ @function get-color-tokens($theme) {
19
+ $is-dark: inspection.get-theme-type($theme) == dark;
20
+ $on-surface: if($is-dark, #fff, #000);
21
+ $ripple-opacities: if($is-dark,
22
+ mdc-ripple-theme.$light-ink-opacities,
23
+ mdc-ripple-theme.$dark-ink-opacities
24
+ );
25
+
26
+ @return (
27
+ // Color of the element that shows the hover, focus and pressed states.
28
+ state-layer-color: $on-surface,
29
+
30
+ // Color of the ripple element.
31
+ ripple-color: rgba($on-surface, 0.1),
32
+
33
+ // Opacity of the ripple when the button is hovered.
34
+ hover-state-layer-opacity: map.get($ripple-opacities, hover),
35
+
36
+ // Opacity of the ripple when the button is focused.
37
+ focus-state-layer-opacity: map.get($ripple-opacities, focus),
38
+
39
+ // Opacity of the ripple when the button is pressed.
40
+ pressed-state-layer-opacity: map.get($ripple-opacities, press),
41
+ );
42
+ }
43
+
44
+ // Generates the mapping for the properties that change based on the button palette color.
45
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
46
+ $color: inspection.get-theme-color($theme, $palette-name);
47
+
48
+ @return (
49
+ state-layer-color: $color,
50
+ ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
51
+ );
52
+ }
53
+
54
+ // Tokens that can be configured through Angular Material's typography theming API.
55
+ @function get-typography-tokens($theme) {
56
+ @return ();
57
+ }
58
+
59
+ // Tokens that can be configured through Angular Material's density theming API.
60
+ @function get-density-tokens($theme) {
61
+ @return ();
62
+ }
63
+
64
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
65
+ // This is used to create token slots.
66
+ @function get-token-slots() {
67
+ @return sass-utils.deep-merge-all(
68
+ get-unthemable-tokens(),
69
+ get-color-tokens(token-utils.$placeholder-color-config),
70
+ get-typography-tokens(token-utils.$placeholder-typography-config),
71
+ get-density-tokens(token-utils.$placeholder-density-config)
72
+ );
73
+ }
@@ -8,6 +8,9 @@ $prefix: (mdc, extended-fab);
8
8
 
9
9
  @function get-unthemable-tokens() {
10
10
  @return (
11
+ // =============================================================================================
12
+ // = TOKENS NOT USED IN ANGULAR MATERIAL =
13
+ // =============================================================================================
11
14
  container-color: null,
12
15
  container-elevation: null,
13
16
  container-height: null,
@@ -22,6 +22,13 @@ $ripple-target: '.mdc-fab__ripple';
22
22
  container-shape: 50%,
23
23
  icon-size: 24px,
24
24
 
25
+ // We don't use this token, because it doesn't set the color of any text inside the FAB.
26
+ // We create a custom token for it instead.
27
+ icon-color: null,
28
+
29
+ // =============================================================================================
30
+ // = TOKENS NOT USED IN ANGULAR MATERIAL =
31
+ // =============================================================================================
25
32
  container-elevation: null,
26
33
  container-height: null,
27
34
  container-shadow-color: null,
@@ -56,10 +63,17 @@ $ripple-target: '.mdc-fab__ripple';
56
63
 
57
64
  // Tokens that can be configured through Angular Material's color theming API.
58
65
  @function get-color-tokens($theme) {
59
- $surface: inspection.get-theme-color($theme, primary, default);
60
- $on-surface: inspection.get-theme-color($theme, primary, default-contrast);
66
+ @return (
67
+ // Background color of the FAB.
68
+ container-color: inspection.get-theme-color($theme, background, card),
69
+ );
70
+ }
61
71
 
62
- @return (container-color: $surface, icon-color: $on-surface);
72
+ // Generates the mapping for the properties that change based on the FAB palette color.
73
+ @function private-get-color-palette-color-tokens($theme, $palette-name) {
74
+ @return (
75
+ container-color: inspection.get-theme-color($theme, $palette-name, default),
76
+ );
63
77
  }
64
78
 
65
79
  // Tokens that can be configured through Angular Material's typography theming API.