@angular/material 17.2.0-next.0 → 17.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/autocomplete/_autocomplete-theme.scss +18 -3
  2. package/chips/_chips-theme.scss +17 -0
  3. package/core/theming/_inspection.scss +1 -1
  4. package/core/theming/_m2-inspection.scss +2 -1
  5. package/core/tokens/m2/_index.scss +7 -2
  6. package/core/tokens/m2/mat/_autocomplete.scss +5 -1
  7. package/core/tokens/m2/mat/_chip.scss +63 -0
  8. package/core/tokens/m2/mat/_form-field.scss +1 -1
  9. package/core/tokens/m2/mat/_select.scss +4 -1
  10. package/core/tokens/m2/mat/_sidenav.scss +3 -0
  11. package/core/tokens/m2/mat/_switch.scss +61 -0
  12. package/core/tokens/m2/mdc/_chip.scss +34 -34
  13. package/core/typography/_typography.scss +126 -1
  14. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  15. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  16. package/esm2022/autocomplete/autocomplete.mjs +5 -5
  17. package/esm2022/autocomplete/module.mjs +5 -5
  18. package/esm2022/badge/badge-module.mjs +5 -5
  19. package/esm2022/badge/badge.mjs +7 -7
  20. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  21. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  22. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  23. package/esm2022/button/button-base.mjs +7 -7
  24. package/esm2022/button/button.mjs +7 -7
  25. package/esm2022/button/fab.mjs +13 -13
  26. package/esm2022/button/icon-button.mjs +7 -7
  27. package/esm2022/button/module.mjs +5 -5
  28. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  29. package/esm2022/button-toggle/button-toggle.mjs +7 -7
  30. package/esm2022/card/card.mjs +43 -43
  31. package/esm2022/card/module.mjs +5 -5
  32. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  33. package/esm2022/checkbox/checkbox.mjs +4 -4
  34. package/esm2022/checkbox/module.mjs +9 -9
  35. package/esm2022/chips/chip-action.mjs +4 -4
  36. package/esm2022/chips/chip-edit-input.mjs +4 -4
  37. package/esm2022/chips/chip-grid.mjs +4 -4
  38. package/esm2022/chips/chip-icons.mjs +10 -10
  39. package/esm2022/chips/chip-input.mjs +4 -4
  40. package/esm2022/chips/chip-listbox.mjs +4 -4
  41. package/esm2022/chips/chip-option.mjs +6 -6
  42. package/esm2022/chips/chip-row.mjs +6 -6
  43. package/esm2022/chips/chip-set.mjs +4 -4
  44. package/esm2022/chips/chip.mjs +5 -5
  45. package/esm2022/chips/module.mjs +5 -5
  46. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  47. package/esm2022/core/datetime/index.mjs +9 -9
  48. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  49. package/esm2022/core/error/error-options.mjs +7 -7
  50. package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
  51. package/esm2022/core/line/line.mjs +8 -8
  52. package/esm2022/core/option/index.mjs +5 -5
  53. package/esm2022/core/option/optgroup.mjs +4 -4
  54. package/esm2022/core/option/option.mjs +5 -5
  55. package/esm2022/core/private/ripple-loader.mjs +4 -4
  56. package/esm2022/core/ripple/index.mjs +5 -5
  57. package/esm2022/core/ripple/ripple.mjs +4 -4
  58. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  59. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  60. package/esm2022/core/version.mjs +1 -1
  61. package/esm2022/datepicker/calendar-body.mjs +4 -4
  62. package/esm2022/datepicker/calendar.mjs +7 -7
  63. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  64. package/esm2022/datepicker/date-range-input.mjs +4 -4
  65. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  66. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  67. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  68. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  69. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  70. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  71. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  72. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  73. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  74. package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
  75. package/esm2022/datepicker/datepicker.mjs +4 -4
  76. package/esm2022/datepicker/month-view.mjs +4 -4
  77. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  78. package/esm2022/datepicker/year-view.mjs +4 -4
  79. package/esm2022/dialog/dialog-container.mjs +4 -4
  80. package/esm2022/dialog/dialog-content-directives.mjs +16 -16
  81. package/esm2022/dialog/dialog.mjs +4 -4
  82. package/esm2022/dialog/module.mjs +5 -5
  83. package/esm2022/divider/divider-module.mjs +5 -5
  84. package/esm2022/divider/divider.mjs +4 -4
  85. package/esm2022/expansion/accordion.mjs +4 -4
  86. package/esm2022/expansion/expansion-module.mjs +5 -5
  87. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  88. package/esm2022/expansion/expansion-panel-header.mjs +10 -10
  89. package/esm2022/expansion/expansion-panel.mjs +7 -7
  90. package/esm2022/form-field/directives/error.mjs +4 -4
  91. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  92. package/esm2022/form-field/directives/hint.mjs +4 -4
  93. package/esm2022/form-field/directives/label.mjs +4 -4
  94. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  95. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  96. package/esm2022/form-field/directives/prefix.mjs +4 -4
  97. package/esm2022/form-field/directives/suffix.mjs +4 -4
  98. package/esm2022/form-field/form-field-control.mjs +4 -4
  99. package/esm2022/form-field/form-field.mjs +4 -4
  100. package/esm2022/form-field/module.mjs +5 -5
  101. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  102. package/esm2022/grid-list/grid-list.mjs +4 -4
  103. package/esm2022/grid-list/grid-tile.mjs +16 -16
  104. package/esm2022/icon/icon-module.mjs +5 -5
  105. package/esm2022/icon/icon-registry.mjs +4 -4
  106. package/esm2022/icon/icon.mjs +4 -4
  107. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  108. package/esm2022/input/input.mjs +4 -4
  109. package/esm2022/input/module.mjs +5 -5
  110. package/esm2022/list/action-list.mjs +4 -4
  111. package/esm2022/list/list-base.mjs +7 -7
  112. package/esm2022/list/list-item-sections.mjs +19 -19
  113. package/esm2022/list/list-module.mjs +5 -5
  114. package/esm2022/list/list-option.mjs +4 -4
  115. package/esm2022/list/list.mjs +7 -7
  116. package/esm2022/list/nav-list.mjs +4 -4
  117. package/esm2022/list/selection-list.mjs +4 -4
  118. package/esm2022/list/subheader.mjs +4 -4
  119. package/esm2022/menu/menu-content.mjs +4 -4
  120. package/esm2022/menu/menu-item.mjs +4 -4
  121. package/esm2022/menu/menu-trigger.mjs +4 -4
  122. package/esm2022/menu/menu.mjs +4 -4
  123. package/esm2022/menu/module.mjs +5 -5
  124. package/esm2022/paginator/module.mjs +5 -5
  125. package/esm2022/paginator/paginator-intl.mjs +4 -4
  126. package/esm2022/paginator/paginator.mjs +4 -4
  127. package/esm2022/progress-bar/module.mjs +5 -5
  128. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  129. package/esm2022/progress-spinner/module.mjs +5 -5
  130. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  131. package/esm2022/radio/module.mjs +5 -5
  132. package/esm2022/radio/radio.mjs +7 -7
  133. package/esm2022/select/module.mjs +5 -5
  134. package/esm2022/select/select.mjs +9 -9
  135. package/esm2022/sidenav/drawer.mjs +12 -12
  136. package/esm2022/sidenav/sidenav-module.mjs +5 -5
  137. package/esm2022/sidenav/sidenav.mjs +12 -12
  138. package/esm2022/slide-toggle/module.mjs +9 -9
  139. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  140. package/esm2022/slide-toggle/slide-toggle.mjs +6 -6
  141. package/esm2022/slider/module.mjs +5 -5
  142. package/esm2022/slider/slider-input.mjs +7 -7
  143. package/esm2022/slider/slider-thumb.mjs +12 -10
  144. package/esm2022/slider/slider.mjs +4 -4
  145. package/esm2022/snack-bar/module.mjs +5 -5
  146. package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
  147. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  148. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  149. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  150. package/esm2022/sort/sort-header-intl.mjs +4 -4
  151. package/esm2022/sort/sort-header.mjs +4 -4
  152. package/esm2022/sort/sort-module.mjs +5 -5
  153. package/esm2022/sort/sort.mjs +4 -4
  154. package/esm2022/stepper/step-content.mjs +4 -4
  155. package/esm2022/stepper/step-header.mjs +4 -4
  156. package/esm2022/stepper/step-label.mjs +4 -4
  157. package/esm2022/stepper/stepper-button.mjs +7 -7
  158. package/esm2022/stepper/stepper-icon.mjs +4 -4
  159. package/esm2022/stepper/stepper-intl.mjs +4 -4
  160. package/esm2022/stepper/stepper-module.mjs +5 -5
  161. package/esm2022/stepper/stepper.mjs +7 -7
  162. package/esm2022/table/cell.mjs +22 -22
  163. package/esm2022/table/module.mjs +5 -5
  164. package/esm2022/table/row.mjs +22 -22
  165. package/esm2022/table/table.mjs +7 -7
  166. package/esm2022/table/text-column.mjs +4 -4
  167. package/esm2022/tabs/module.mjs +5 -5
  168. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  169. package/esm2022/tabs/tab-body.mjs +7 -7
  170. package/esm2022/tabs/tab-content.mjs +4 -4
  171. package/esm2022/tabs/tab-group.mjs +4 -4
  172. package/esm2022/tabs/tab-header.mjs +4 -4
  173. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  174. package/esm2022/tabs/tab-label.mjs +4 -4
  175. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  176. package/esm2022/tabs/tab.mjs +4 -4
  177. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  178. package/esm2022/toolbar/toolbar.mjs +7 -7
  179. package/esm2022/tooltip/module.mjs +5 -5
  180. package/esm2022/tooltip/tooltip.mjs +7 -7
  181. package/esm2022/tree/node.mjs +10 -10
  182. package/esm2022/tree/outlet.mjs +4 -4
  183. package/esm2022/tree/padding.mjs +4 -4
  184. package/esm2022/tree/toggle.mjs +4 -4
  185. package/esm2022/tree/tree-module.mjs +5 -5
  186. package/esm2022/tree/tree.mjs +4 -4
  187. package/fesm2022/autocomplete.mjs +14 -14
  188. package/fesm2022/autocomplete.mjs.map +1 -1
  189. package/fesm2022/badge.mjs +10 -10
  190. package/fesm2022/badge.mjs.map +1 -1
  191. package/fesm2022/bottom-sheet.mjs +10 -10
  192. package/fesm2022/bottom-sheet.mjs.map +1 -1
  193. package/fesm2022/button-toggle.mjs +10 -10
  194. package/fesm2022/button-toggle.mjs.map +1 -1
  195. package/fesm2022/button.mjs +34 -34
  196. package/fesm2022/button.mjs.map +1 -1
  197. package/fesm2022/card.mjs +46 -46
  198. package/fesm2022/card.mjs.map +1 -1
  199. package/fesm2022/checkbox.mjs +14 -14
  200. package/fesm2022/checkbox.mjs.map +1 -1
  201. package/fesm2022/chips.mjs +45 -45
  202. package/fesm2022/chips.mjs.map +1 -1
  203. package/fesm2022/core.mjs +60 -60
  204. package/fesm2022/core.mjs.map +1 -1
  205. package/fesm2022/datepicker.mjs +82 -82
  206. package/fesm2022/datepicker.mjs.map +1 -1
  207. package/fesm2022/dialog.mjs +25 -25
  208. package/fesm2022/dialog.mjs.map +1 -1
  209. package/fesm2022/divider.mjs +7 -7
  210. package/fesm2022/divider.mjs.map +1 -1
  211. package/fesm2022/expansion.mjs +25 -25
  212. package/fesm2022/expansion.mjs.map +1 -1
  213. package/fesm2022/form-field.mjs +34 -34
  214. package/fesm2022/form-field.mjs.map +1 -1
  215. package/fesm2022/grid-list.mjs +22 -22
  216. package/fesm2022/grid-list.mjs.map +1 -1
  217. package/fesm2022/icon/testing.mjs +7 -7
  218. package/fesm2022/icon/testing.mjs.map +1 -1
  219. package/fesm2022/icon.mjs +10 -10
  220. package/fesm2022/icon.mjs.map +1 -1
  221. package/fesm2022/input.mjs +7 -7
  222. package/fesm2022/input.mjs.map +1 -1
  223. package/fesm2022/list.mjs +49 -49
  224. package/fesm2022/list.mjs.map +1 -1
  225. package/fesm2022/menu.mjs +16 -16
  226. package/fesm2022/menu.mjs.map +1 -1
  227. package/fesm2022/paginator.mjs +10 -10
  228. package/fesm2022/paginator.mjs.map +1 -1
  229. package/fesm2022/progress-bar.mjs +7 -7
  230. package/fesm2022/progress-bar.mjs.map +1 -1
  231. package/fesm2022/progress-spinner.mjs +7 -7
  232. package/fesm2022/progress-spinner.mjs.map +1 -1
  233. package/fesm2022/radio.mjs +10 -10
  234. package/fesm2022/radio.mjs.map +1 -1
  235. package/fesm2022/select.mjs +12 -12
  236. package/fesm2022/select.mjs.map +1 -1
  237. package/fesm2022/sidenav.mjs +26 -26
  238. package/fesm2022/sidenav.mjs.map +1 -1
  239. package/fesm2022/slide-toggle.mjs +16 -16
  240. package/fesm2022/slide-toggle.mjs.map +1 -1
  241. package/fesm2022/slider.mjs +24 -22
  242. package/fesm2022/slider.mjs.map +1 -1
  243. package/fesm2022/snack-bar.mjs +22 -22
  244. package/fesm2022/snack-bar.mjs.map +1 -1
  245. package/fesm2022/sort.mjs +13 -13
  246. package/fesm2022/sort.mjs.map +1 -1
  247. package/fesm2022/stepper.mjs +31 -31
  248. package/fesm2022/stepper.mjs.map +1 -1
  249. package/fesm2022/table.mjs +55 -55
  250. package/fesm2022/table.mjs.map +1 -1
  251. package/fesm2022/tabs.mjs +40 -40
  252. package/fesm2022/tabs.mjs.map +1 -1
  253. package/fesm2022/toolbar.mjs +10 -10
  254. package/fesm2022/toolbar.mjs.map +1 -1
  255. package/fesm2022/tooltip.mjs +10 -10
  256. package/fesm2022/tooltip.mjs.map +1 -1
  257. package/fesm2022/tree.mjs +25 -25
  258. package/fesm2022/tree.mjs.map +1 -1
  259. package/package.json +2 -2
  260. package/prebuilt-themes/deeppurple-amber.css +1 -1
  261. package/prebuilt-themes/indigo-pink.css +1 -1
  262. package/prebuilt-themes/pink-bluegrey.css +1 -1
  263. package/prebuilt-themes/purple-green.css +1 -1
  264. package/schematics/ng-add/index.js +1 -1
  265. package/schematics/ng-add/index.mjs +1 -1
  266. package/schematics/ng-generate/mdc-migration/index_bundled.js +87 -53
  267. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +2 -2
  268. package/schematics/ng-update/index_bundled.js +31 -31
  269. package/select/_select-theme.scss +6 -1
  270. package/slide-toggle/_slide-toggle-theme.scss +46 -26
@@ -10,7 +10,12 @@
10
10
  @if inspection.get-theme-version($theme) == 1 {
11
11
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
12
12
  }
13
- @else {}
13
+ @else {
14
+ @include sass-utils.current-selector-or-root() {
15
+ @include token-utils.create-token-values(tokens-mat-autocomplete.$prefix,
16
+ tokens-mat-autocomplete.get-unthemable-tokens());
17
+ }
18
+ }
14
19
  }
15
20
 
16
21
  @mixin color($theme) {
@@ -29,14 +34,24 @@
29
34
  @if inspection.get-theme-version($theme) == 1 {
30
35
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
31
36
  }
32
- @else {}
37
+ @else {
38
+ @include sass-utils.current-selector-or-root() {
39
+ @include token-utils.create-token-values(tokens-mat-autocomplete.$prefix,
40
+ tokens-mat-autocomplete.get-typography-tokens($theme));
41
+ }
42
+ }
33
43
  }
34
44
 
35
45
  @mixin density($theme) {
36
46
  @if inspection.get-theme-version($theme) == 1 {
37
47
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
38
48
  }
39
- @else {}
49
+ @else {
50
+ @include sass-utils.current-selector-or-root() {
51
+ @include token-utils.create-token-values(tokens-mat-autocomplete.$prefix,
52
+ tokens-mat-autocomplete.get-density-tokens($theme));
53
+ }
54
+ }
40
55
  }
41
56
 
42
57
  @mixin theme($theme) {
@@ -1,6 +1,7 @@
1
1
  @use 'sass:color';
2
2
  @use '@material/chips/chip-theme' as mdc-chip-theme;
3
3
  @use '../core/tokens/m2/mdc/chip' as tokens-mdc-chip;
4
+ @use '../core/tokens/m2/mat/chip' as tokens-mat-chip;
4
5
  @use '../core/tokens/token-utils';
5
6
  @use '../core/theming/theming';
6
7
  @use '../core/theming/inspection';
@@ -16,6 +17,8 @@
16
17
  @else {
17
18
  .mat-mdc-standard-chip {
18
19
  @include mdc-chip-theme.theme(tokens-mdc-chip.get-unthemable-tokens());
20
+ @include token-utils.create-token-values(
21
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-unthemable-tokens());
19
22
  }
20
23
  }
21
24
  }
@@ -33,22 +36,30 @@
33
36
  .mat-mdc-standard-chip {
34
37
  $default-color-tokens: tokens-mdc-chip.get-color-tokens($theme);
35
38
  @include mdc-chip-theme.theme($default-color-tokens);
39
+ @include token-utils.create-token-values(
40
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme));
36
41
 
37
42
  &.mat-mdc-chip-selected,
38
43
  &.mat-mdc-chip-highlighted {
39
44
  &.mat-primary {
40
45
  $primary-color-tokens: tokens-mdc-chip.get-color-tokens($theme, primary);
41
46
  @include mdc-chip-theme.theme($primary-color-tokens);
47
+ @include token-utils.create-token-values(
48
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, primary));
42
49
  }
43
50
 
44
51
  &.mat-accent {
45
52
  $accent-color-tokens: tokens-mdc-chip.get-color-tokens($theme, accent);
46
53
  @include mdc-chip-theme.theme($accent-color-tokens);
54
+ @include token-utils.create-token-values(
55
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, accent));
47
56
  }
48
57
 
49
58
  &.mat-warn {
50
59
  $warn-color-tokens: tokens-mdc-chip.get-color-tokens($theme, warn);
51
60
  @include mdc-chip-theme.theme($warn-color-tokens);
61
+ @include token-utils.create-token-values(
62
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-color-tokens($theme, warn));
52
63
  }
53
64
  }
54
65
  }
@@ -66,6 +77,8 @@
66
77
 
67
78
  .mat-mdc-standard-chip {
68
79
  @include mdc-chip-theme.theme($typography-tokens);
80
+ @include token-utils.create-token-values(
81
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-typography-tokens($theme));
69
82
  }
70
83
  }
71
84
  }
@@ -81,6 +94,8 @@
81
94
 
82
95
  .mat-mdc-chip.mat-mdc-standard-chip {
83
96
  @include mdc-chip-theme.theme($density-tokens);
97
+ @include token-utils.create-token-values(
98
+ tokens-mat-chip.$prefix, tokens-mat-chip.get-density-tokens($theme));
84
99
  }
85
100
  }
86
101
  }
@@ -112,5 +127,7 @@
112
127
 
113
128
  @mixin _theme-from-tokens($tokens, $options...) {
114
129
  $mdc-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-chip.$prefix, $options...);
130
+ $mat-chip-tokens: token-utils.get-tokens-for($tokens, tokens-mat-chip.$prefix, $options...);
115
131
  @include mdc-chip-theme.theme($mdc-chip-tokens);
132
+ @include token-utils.create-token-values(tokens-mat-chip.$prefix, $mat-chip-tokens);
116
133
  }
@@ -285,7 +285,7 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
285
285
  }
286
286
  $result: ();
287
287
  @each $system in $systems {
288
- $result: map.deep-merge($result, map.get($theme, $_internals, '#{$system}-tokens'));
288
+ $result: map.deep-merge($result, map.get($theme, $_internals, '#{$system}-tokens') or ());
289
289
  }
290
290
  @return $result;
291
291
  }
@@ -123,7 +123,8 @@ $_typography-properties: (font, font-family, line-height, font-size, letter-spac
123
123
  }
124
124
  $palette: map.get($colors, $palette-name);
125
125
  @if not $palette {
126
- @error 'Unrecognized palette name:' $palette-name;
126
+ @error $palette-name $args $theme;
127
+ @error #{'Unrecognized palette name:'} $palette-name;
127
128
  }
128
129
  @return theming.get-color-from-palette($palette, $args...);
129
130
  }
@@ -11,6 +11,7 @@
11
11
  @use './mat/dialog' as tokens-mat-dialog;
12
12
  @use './mat/bottom-sheet' as tokens-mat-bottom-sheet;
13
13
  @use './mat/card' as tokens-mat-card;
14
+ @use './mat/chip' as tokens-mat-chip;
14
15
  @use './mat/datepicker' as tokens-mat-datepicker;
15
16
  @use './mat/divider' as tokens-mat-divider;
16
17
  @use './mat/expansion' as tokens-mat-expansion;
@@ -32,6 +33,7 @@
32
33
  @use './mat/select' as tokens-mat-select;
33
34
  @use './mat/sidenav' as tokens-mat-sidenav;
34
35
  @use './mat/slider' as tokens-mat-slider;
36
+ @use './mat/switch' as tokens-mat-switch;
35
37
  @use './mat/snack-bar' as tokens-mat-snack-bar;
36
38
  @use './mat/sort' as tokens-mat-sort;
37
39
  @use './mat/standard-button-toggle' as tokens-mat-button-toggle;
@@ -67,6 +69,7 @@
67
69
  @use './mdc/switch' as tokens-mdc-switch;
68
70
  @use './mdc/tab' as tokens-mdc-tab;
69
71
  @use './mdc/tab-indicator' as tokens-mdc-tab-indicator;
72
+ @use '../../theming/inspection';
70
73
 
71
74
  /// Gets the tokens for the given theme, m2 tokens module, and theming system.
72
75
  /// @param {Map} $theme The Angular Material theme object to generate token values from.
@@ -80,11 +83,11 @@
80
83
  @return meta.call(
81
84
  meta.get-function(get-#{$system}-tokens, $module: $module));
82
85
  }
83
- @if not map.get($theme, $system) {
86
+ @if not inspection.theme-has($theme, $system) {
84
87
  @return ();
85
88
  }
86
89
  @return meta.call(
87
- meta.get-function(get-#{$system}-tokens, $module: $module), map.get($theme, $system));
90
+ meta.get-function(get-#{$system}-tokens, $module: $module), $theme);
88
91
  }
89
92
 
90
93
  /// Gets the fully qualified tokens map for the given theme and m2 tokens module.
@@ -117,6 +120,7 @@
117
120
  _get-tokens-for-module($theme, tokens-mat-bottom-sheet),
118
121
  _get-tokens-for-module($theme, tokens-mat-button-toggle),
119
122
  _get-tokens-for-module($theme, tokens-mat-card),
123
+ _get-tokens-for-module($theme, tokens-mat-chip),
120
124
  _get-tokens-for-module($theme, tokens-mat-datepicker),
121
125
  _get-tokens-for-module($theme, tokens-mat-dialog),
122
126
  _get-tokens-for-module($theme, tokens-mat-divider),
@@ -142,6 +146,7 @@
142
146
  _get-tokens-for-module($theme, tokens-mat-select),
143
147
  _get-tokens-for-module($theme, tokens-mat-sidenav),
144
148
  _get-tokens-for-module($theme, tokens-mat-slider),
149
+ _get-tokens-for-module($theme, tokens-mat-switch),
145
150
  _get-tokens-for-module($theme, tokens-mat-snack-bar),
146
151
  _get-tokens-for-module($theme, tokens-mat-sort),
147
152
  _get-tokens-for-module($theme, tokens-mat-stepper),
@@ -1,3 +1,4 @@
1
+ @use '@material/elevation/elevation-theme' as mdc-elevation;
1
2
  @use '../../token-utils';
2
3
  @use '../../../theming/inspection';
3
4
  @use '../../../style/sass-utils';
@@ -8,7 +9,10 @@ $prefix: (mat, autocomplete);
8
9
  // Tokens that can't be configured through Angular Material's current theming API,
9
10
  // but may be in a future version of the theming API.
10
11
  @function get-unthemable-tokens() {
11
- @return ();
12
+ @return (
13
+ container-shape: 4px,
14
+ container-elevation-shadow: mdc-elevation.elevation-box-shadow(8),
15
+ );
12
16
  }
13
17
 
14
18
  // Tokens that can be configured through Angular Material's color theming API.
@@ -0,0 +1,63 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../theming/inspection';
4
+ @use '../../../style/sass-utils';
5
+ @use '../../../theming/palette';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, chip);
9
+
10
+ // Tokens that can't be configured through Angular Material's current theming API,
11
+ // but may be in a future version of the theming API.
12
+ @function get-unthemable-tokens() {
13
+ @return (
14
+ disabled-container-opacity: 0.4,
15
+ trailing-action-opacity: 0.54,
16
+ trailing-action-focus-opacity: 1,
17
+ trailing-action-state-layer-color: transparent,
18
+ selected-trailing-action-state-layer-color: transparent,
19
+ trailing-action-hover-state-layer-opacity: 0,
20
+ trailing-action-focus-state-layer-opacity: 0,
21
+ );
22
+ }
23
+
24
+ // Tokens that can be configured through Angular Material's color theming API.
25
+ @function get-color-tokens($theme, $palette-name: null) {
26
+ $foreground: null;
27
+ @if $palette-name == null {
28
+ $is-dark: inspection.get-theme-type($theme) == dark;
29
+ $grey-50: map.get(palette.$grey-palette, 50);
30
+ $grey-900: map.get(palette.$grey-palette, 900);
31
+ $foreground: if($is-dark, $grey-50, $grey-900);
32
+ }
33
+ @else {
34
+ $foreground: inspection.get-theme-color($theme, $palette-name, default-contrast);
35
+ }
36
+ @return (
37
+ // The color of the icon at the end of a disabled chip.
38
+ selected-disabled-trailing-icon-color: $foreground,
39
+ // The color of the icon at the end of the chip.
40
+ selected-trailing-icon-color: $foreground
41
+ );
42
+ }
43
+
44
+ // Tokens that can be configured through Angular Material's typography theming API.
45
+ @function get-typography-tokens($theme) {
46
+ @return ();
47
+ }
48
+
49
+ // Tokens that can be configured through Angular Material's density theming API.
50
+ @function get-density-tokens($theme) {
51
+ @return ();
52
+ }
53
+
54
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
55
+ // This is used to create token slots.
56
+ @function get-token-slots() {
57
+ @return sass-utils.deep-merge-all(
58
+ get-unthemable-tokens(),
59
+ get-color-tokens(token-utils.$placeholder-color-config),
60
+ get-typography-tokens(token-utils.$placeholder-typography-config),
61
+ get-density-tokens(token-utils.$placeholder-density-config)
62
+ );
63
+ }
@@ -60,7 +60,7 @@ $prefix: (mat, form-field);
60
60
  disabled-select-arrow-color: rgba($on-surface, 0.38),
61
61
 
62
62
  hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
63
- focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
63
+ focus-state-layer-opacity: if($is-dark, 0.24, 0.08),
64
64
  ));
65
65
  }
66
66
 
@@ -1,6 +1,7 @@
1
1
  @use '../../token-utils';
2
2
  @use '../../../theming/inspection';
3
3
  @use '../../../style/sass-utils';
4
+ @use '@material/elevation/elevation-theme' as mdc-elevation;
4
5
 
5
6
  // The prefix used to generate the fully qualified name for tokens in this file.
6
7
  $prefix: (mat, select);
@@ -8,7 +9,9 @@ $prefix: (mat, select);
8
9
  // Tokens that can't be configured through Angular Material's current theming API,
9
10
  // but may be in a future version of the theming API.
10
11
  @function get-unthemable-tokens() {
11
- @return ();
12
+ @return (
13
+ container-elevation-shadow: mdc-elevation.elevation-box-shadow(8),
14
+ );
12
15
  }
13
16
 
14
17
  // Tokens that can be configured through Angular Material's color theming API.
@@ -1,3 +1,4 @@
1
+ @use '@material/elevation/elevation-theme' as mdc-elevation;
1
2
  @use 'sass:color';
2
3
  @use 'sass:meta';
3
4
  @use '../../token-utils';
@@ -14,6 +15,8 @@ $prefix: (mat, sidenav);
14
15
  // Currently zero, but it appears to be relevant for M3.
15
16
  // See: https://m3.material.io/components/navigation-drawer/overview
16
17
  container-shape: 0,
18
+ container-elevation-shadow: mdc-elevation.elevation-box-shadow(16),
19
+ container-width: auto,
17
20
  );
18
21
  }
19
22
 
@@ -0,0 +1,61 @@
1
+ @use '../../token-utils';
2
+ @use '../../../style/sass-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mat, switch);
6
+
7
+ // Tokens that can't be configured through Angular Material's current theming API,
8
+ // but may be in a future version of the theming API.
9
+ @function get-unthemable-tokens() {
10
+ @return (
11
+ unselected-handle-size: 20px,
12
+ selected-handle-size: 20px,
13
+ pressed-handle-size: 20px,
14
+ with-icon-handle-size: 20px,
15
+
16
+ selected-handle-horizontal-margin: 0,
17
+ selected-with-icon-handle-horizontal-margin: 0,
18
+ selected-pressed-handle-horizontal-margin: 0,
19
+ unselected-handle-horizontal-margin: 0,
20
+ unselected-with-icon-handle-horizontal-margin: 0,
21
+ unselected-pressed-handle-horizontal-margin: 0,
22
+
23
+ // The hidden and visible track represent whichever track is visible or
24
+ // hidden in the ui. This could be the .mdc-switch__track :before or
25
+ // :after depending on whether the switch is selected or unselected.
26
+ //
27
+ // The m2 slide-toggle uses transforms to hide & show the tracks while
28
+ // the m3 slide-toggle uses opacity.
29
+
30
+ visible-track-opacity: 1,
31
+ hidden-track-opacity: 1,
32
+ visible-track-transition: transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1),
33
+ hidden-track-transition: transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1),
34
+ );
35
+ }
36
+
37
+ // Tokens that can be configured through Angular Material's color theming API.
38
+ @function get-color-tokens($theme) {
39
+ @return ();
40
+ }
41
+
42
+ // Tokens that can be configured through Angular Material's typography theming API.
43
+ @function get-typography-tokens($theme) {
44
+ @return ();
45
+ }
46
+
47
+ // Tokens that can be configured through Angular Material's density theming API.
48
+ @function get-density-tokens($theme) {
49
+ @return ();
50
+ }
51
+
52
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
53
+ // This is used to create token slots.
54
+ @function get-token-slots() {
55
+ @return sass-utils.deep-merge-all(
56
+ get-unthemable-tokens(),
57
+ get-color-tokens(token-utils.$placeholder-color-config),
58
+ get-typography-tokens(token-utils.$placeholder-typography-config),
59
+ get-density-tokens(token-utils.$placeholder-density-config)
60
+ );
61
+ }
@@ -39,6 +39,26 @@ $prefix: (mdc, chip);
39
39
  with-avatar-avatar-size: 28px,
40
40
  // The width & height of the chip icon.
41
41
  with-icon-icon-size: 18px,
42
+ // The chip's border width.
43
+ outline-width: 0,
44
+ // The chip's border color.
45
+ outline-color: transparent,
46
+ // The chip's border color when disabled.
47
+ disabled-outline-color: transparent,
48
+ // The chip's border color when focused.
49
+ focus-outline-color: transparent,
50
+ // The opacity of the chip's state overlay when hovered.
51
+ hover-state-layer-opacity: 0.04,
52
+ // The opacity of the chip's avatar when disabled.
53
+ with-avatar-disabled-avatar-opacity: 1,
54
+ // The chip's border width when selected.
55
+ flat-selected-outline-width: 0,
56
+ // The opacity of the chip's state overlay when selected and hovered.
57
+ selected-hover-state-layer-opacity: 0.04,
58
+ // The opacity of the chip's trailing icon when it is disabled.
59
+ with-trailing-icon-disabled-trailing-icon-opacity: 1,
60
+ // The opacity of the chip's leading icon when it is disabled.
61
+ with-icon-disabled-icon-opacity: 1,
42
62
  // Not used by MDC.
43
63
  disabled-label-text-opacity: null,
44
64
  // Not used by MDC.
@@ -52,29 +72,17 @@ $prefix: (mdc, chip);
52
72
  // Our chips do not have a border.
53
73
  flat-outline-width: null,
54
74
  // Our chips do not have a border.
55
- flat-selected-outline-width: null,
56
- // Our chips do not have a border.
57
75
  flat-unselected-outline-width: null,
58
- // Our chips do not have a border.
59
- outline-width: null,
60
- // Not used by MDC.
61
- with-avatar-disabled-avatar-opacity: null,
62
- // Not used by MDC.
63
- with-icon-disabled-icon-opacity: null,
64
76
  // Not used by MDC.
65
77
  with-leading-icon-disabled-leading-icon-opacity: null,
66
78
  // Not used by MDC.
67
79
  with-leading-icon-leading-icon-size: null,
68
80
  // Not used by MDC.
69
- with-trailing-icon-disabled-trailing-icon-opacity: null,
70
- // Not used by MDC.
71
81
  with-trailing-icon-trailing-icon-size: null,
72
82
  // Elevated chips not implemented.
73
83
  container-elevation: null,
74
84
  // Elevated chips not implemented.
75
85
  container-shadow-color: null,
76
- // Our chips do not have a border.
77
- disabled-outline-color: null,
78
86
  // Elevated chips not implemented.
79
87
  elevated-container-elevation: null,
80
88
  // Elevated chips not implemented.
@@ -90,8 +98,6 @@ $prefix: (mdc, chip);
90
98
  // Elevated chips not implemented.
91
99
  elevated-pressed-container-elevation: null,
92
100
  // Elevated chips not implemented.
93
- elevated-selected-container-color: null,
94
- // Elevated chips not implemented.
95
101
  elevated-selected-container-elevation: null,
96
102
  // Elevated chips not implemented.
97
103
  elevated-unselected-container-color: null,
@@ -99,8 +105,6 @@ $prefix: (mdc, chip);
99
105
  flat-container-elevation: null,
100
106
  // Our chips do not have a border.
101
107
  flat-disabled-outline-color: null,
102
- // Not providing this uses
103
- flat-disabled-selected-container-color: null,
104
108
  // Not used by MDC.
105
109
  flat-disabled-selected-container-opacity: null,
106
110
  // Unused.
@@ -136,16 +140,8 @@ $prefix: (mdc, chip);
136
140
  // Unused.
137
141
  focus-label-text-color: null,
138
142
  // Unused.
139
- focus-outline-color: null,
140
- // Unused.
141
143
  hover-label-text-color: null,
142
144
  // Unused.
143
- hover-state-layer-color: null,
144
- // Unused.
145
- hover-state-layer-opacity: null,
146
- // Unused.
147
- outline-color: null,
148
- // Unused.
149
145
  pressed-label-text-color: null,
150
146
  // Unused.
151
147
  pressed-state-layer-color: null,
@@ -154,18 +150,8 @@ $prefix: (mdc, chip);
154
150
  // Unused.
155
151
  selected-focus-label-text-color: null,
156
152
  // Unused.
157
- selected-focus-state-layer-color: null,
158
- // Unused.
159
- selected-focus-state-layer-opacity: null,
160
- // Unused.
161
153
  selected-hover-label-text-color: null,
162
154
  // Unused.
163
- selected-hover-state-layer-color: null,
164
- // Unused.
165
- selected-hover-state-layer-opacity: null,
166
- // Unused.
167
- selected-label-text-color: null,
168
- // Unused.
169
155
  selected-pressed-label-text-color: null,
170
156
  // Unused.
171
157
  selected-pressed-state-layer-color: null,
@@ -265,14 +251,28 @@ $prefix: (mdc, chip);
265
251
  disabled-label-text-color: $foreground,
266
252
  // The background-color of the chip.
267
253
  elevated-container-color: $background,
254
+ // The background-color of the chip when selected.
255
+ elevated-selected-container-color: $background,
268
256
  // The background-color of a disabled chip.
269
257
  elevated-disabled-container-color: $background,
258
+ // The background color of the chip when disabled and selected.
259
+ flat-disabled-selected-container-color: $background,
270
260
  // The color of the focus state layer.
271
261
  focus-state-layer-color: $state-layer-color,
262
+ // The color of the hover state layer.
263
+ hover-state-layer-color: $state-layer-color,
264
+ // The color of the chip's state overlay when selected and hovered.
265
+ selected-hover-state-layer-color: $state-layer-color,
272
266
  // The opacity of the focus state layer.
273
267
  focus-state-layer-opacity: $state-layer-opacity,
268
+ // The color of the chip's state overlay when selected and focused.
269
+ selected-focus-state-layer-color: $state-layer-color,
270
+ // The opacity of the chip's state overlay when selected and focused.
271
+ selected-focus-state-layer-opacity: $state-layer-opacity,
274
272
  // The chip text color.
275
273
  label-text-color: $foreground,
274
+ // The chip text color when selected.
275
+ selected-label-text-color: $foreground,
276
276
  // The icon color of a chip.
277
277
  with-icon-icon-color: $foreground,
278
278
  // The color of the icon of a disabled chip.
@@ -1,3 +1,6 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:string';
1
4
  @use 'typography-utils';
2
5
  @use '../theming/inspection';
3
6
  @use './versioning';
@@ -8,11 +11,133 @@
8
11
  @forward './definition';
9
12
  @forward './versioning';
10
13
 
14
+ @mixin typography-hierarchy($theme, $selector: '.mat-typography', $back-compat: false) {
15
+ @if inspection.get-theme-version($theme) == 1 {
16
+ @include _m3-typography-hierarchy($theme, $selector, $back-compat);
17
+ }
18
+ @else {
19
+ @include _m2-typography-hierarchy($theme, $selector);
20
+ }
21
+ }
22
+
23
+ @function _get-selector($selectors, $prefix) {
24
+ $result: ();
25
+ @each $selector in $selectors {
26
+ // Don't add "naked" tag selectors, and don't nest prefix selector.
27
+ @if string.index($selector, '.') == 1 {
28
+ $result: list.append($result, $selector, $separator: comma);
29
+ }
30
+ // Don't nest the prefix selector in itself.
31
+ @if $selector != $prefix {
32
+ $result: list.append($result, '#{$prefix} #{$selector}', $separator: comma);
33
+ }
34
+ }
35
+ @return $result;
36
+ }
37
+
38
+ @mixin _m3-typography-level($theme, $selector-prefix, $level, $selectors, $margin: null) {
39
+ #{_get-selector($selectors, $selector-prefix)} {
40
+ // TODO(mmalerba): When we expose system tokens as CSS vars, we should change this to emit token
41
+ // slots.
42
+ font: inspection.get-theme-typography($theme, $level, font);
43
+ letter-spacing: inspection.get-theme-typography($theme, $level, letter-spacing);
44
+ @if $margin != null {
45
+ margin: 0 0 $margin;
46
+ }
47
+ }
48
+ }
49
+
50
+ @mixin _m3-typography-hierarchy($theme, $selector-prefix, $add-m2-selectors) {
51
+ $levels: (
52
+ display-large: (
53
+ selectors: ('.mat-display-large', 'h1'),
54
+ m2-selectors: ('.mat-h1', '.mat-headline-1'),
55
+ margin: 0.5em
56
+ ),
57
+ display-medium: (
58
+ selectors: ('.mat-display-medium', 'h2'),
59
+ m2-selectors: ('.mat-h2', '.mat-headline-2'),
60
+ margin: 0.5em
61
+ ),
62
+ display-small: (
63
+ selectors: ('.mat-display-small', 'h3'),
64
+ m2-selectors: ('.mat-h3', '.mat-headline-3'),
65
+ margin: 0.5em
66
+ ),
67
+ headline-large: (
68
+ selectors: ('.mat-headline-large', 'h4'),
69
+ m2-selectors: ('.mat-h4', '.mat-headline-4'),
70
+ margin: 0.5em
71
+ ),
72
+ headline-medium: (
73
+ selectors: ('.mat-headline-medium', 'h5'),
74
+ m2-selectors: ('.mat-h5', '.mat-headline-5'),
75
+ margin: 0.5em
76
+ ),
77
+ headline-small: (
78
+ selectors: ('.mat-headline-small', 'h6'),
79
+ m2-selectors: ('.mat-h6', '.mat-headline-6'),
80
+ margin: 0.5em
81
+ ),
82
+ title-large: (
83
+ selectors: ('.mat-title-large'),
84
+ m2-selectors: ('.mat-subtitle-1'),
85
+ ),
86
+ title-medium: (
87
+ selectors: ('.mat-title-medium'),
88
+ m2-selectors: ('.mat-subtitle-2'),
89
+ ),
90
+ title-small: (
91
+ selectors: ('.mat-title-small')
92
+ ),
93
+ body-large: (
94
+ selectors: ('.mat-body-large', $selector-prefix),
95
+ m2-selectors: ('.mat-body', '.mat-body-strong', '.mat-body-2'),
96
+ ),
97
+ body-medium: (
98
+ selectors: ('.mat-body-medium')
99
+ ),
100
+ body-small: (
101
+ selectors: ('.mat-body-small')
102
+ ),
103
+ label-large: (
104
+ selectors: ('.mat-label-large')
105
+ ),
106
+ label-medium: (
107
+ selectors: ('.mat-label-medium')
108
+ ),
109
+ label-small: (
110
+ selectors: ('.mat-label-small'),
111
+ m2-selectors: ('.mat-small', '.mat-caption')
112
+ ),
113
+ );
114
+
115
+ @each $level, $options in $levels {
116
+ @if $add-m2-selectors {
117
+ $options: map.set($options, selectors,
118
+ list.join(map.get($options, selectors), map.get($options, m2-selectors) or ()));
119
+ }
120
+ $options: map.remove($options, m2-selectors);
121
+
122
+ // Apply styles for the level.
123
+ @include _m3-typography-level($theme, $selector-prefix, $level, $options...);
124
+
125
+ // Also style <p> inside body-large.
126
+ @if $level == body-large {
127
+ #{_get-selector(map.get($options, selectors), $selector-prefix)} {
128
+ p {
129
+ margin: 0 0 0.75em;
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+
11
136
  /// Emits baseline typographic styles based on a given config.
12
137
  /// @param {Map} $config-or-theme A typography config for an entire theme.
13
138
  /// @param {String} $selector Ancestor selector under which native elements, such as h1, will
14
139
  /// be styled.
15
- @mixin typography-hierarchy($theme, $selector: '.mat-typography') {
140
+ @mixin _m2-typography-hierarchy($theme, $selector) {
16
141
  // Note that it seems redundant to prefix the class rules with the `$selector`, however it's
17
142
  // necessary if we want to allow people to overwrite the tag selectors. This is due to
18
143
  // selectors like `#{$selector} h1` being more specific than ones like `.mat-title`.