@angular/material 17.1.0-next.3 → 17.1.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 (289) hide show
  1. package/LICENSE +1 -1
  2. package/_index.scss +6 -6
  3. package/bottom-sheet/index.d.ts +2 -4
  4. package/button/_button-base.scss +6 -0
  5. package/button/_button-theme.scss +131 -97
  6. package/button/_fab-theme.scss +1 -0
  7. package/button/_icon-button-theme.scss +11 -9
  8. package/core/_core-theme.scss +6 -7
  9. package/core/_core.scss +17 -2
  10. package/core/index.d.ts +4 -1
  11. package/core/mdc-helpers/_mdc-helpers.scss +0 -184
  12. package/core/style/_sass-utils.scss +19 -0
  13. package/core/tokens/_token-utils.scss +56 -0
  14. package/core/tokens/m2/_index.scss +19 -5
  15. package/core/tokens/m2/mat/{_slide-toggle.scss → _app.scss} +12 -15
  16. package/core/tokens/m2/mat/_form-field.scss +50 -1
  17. package/core/tokens/m2/mat/_slider.scss +34 -8
  18. package/core/tokens/m2/mdc/_extended-fab.scss +7 -6
  19. package/core/tokens/m2/mdc/_fab.scss +5 -5
  20. package/core/tokens/m2/mdc/_filled-button.scss +6 -6
  21. package/core/tokens/m2/mdc/_protected-button.scss +7 -7
  22. package/core/tokens/m2/mdc/_text-button.scss +0 -4
  23. package/esm2022/autocomplete/autocomplete-origin.mjs +3 -3
  24. package/esm2022/autocomplete/autocomplete-trigger.mjs +7 -5
  25. package/esm2022/autocomplete/autocomplete.mjs +4 -5
  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 +7 -8
  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 +6 -6
  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 +16 -11
  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/internal-form-field/internal-form-field.mjs +3 -3
  60. package/esm2022/core/line/line.mjs +7 -7
  61. package/esm2022/core/option/index.mjs +4 -4
  62. package/esm2022/core/option/optgroup.mjs +3 -3
  63. package/esm2022/core/option/option.mjs +3 -3
  64. package/esm2022/core/private/ripple-loader.mjs +3 -3
  65. package/esm2022/core/ripple/index.mjs +4 -4
  66. package/esm2022/core/ripple/ripple-renderer.mjs +1 -1
  67. package/esm2022/core/ripple/ripple.mjs +3 -3
  68. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +4 -4
  69. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
  70. package/esm2022/core/version.mjs +1 -1
  71. package/esm2022/datepicker/calendar-body.mjs +3 -3
  72. package/esm2022/datepicker/calendar.mjs +8 -8
  73. package/esm2022/datepicker/date-range-input-parts.mjs +9 -9
  74. package/esm2022/datepicker/date-range-input.mjs +3 -3
  75. package/esm2022/datepicker/date-range-picker.mjs +3 -3
  76. package/esm2022/datepicker/date-range-selection-strategy.mjs +3 -3
  77. package/esm2022/datepicker/date-selection-model.mjs +9 -9
  78. package/esm2022/datepicker/datepicker-actions.mjs +9 -9
  79. package/esm2022/datepicker/datepicker-base.mjs +6 -6
  80. package/esm2022/datepicker/datepicker-errors.mjs +4 -4
  81. package/esm2022/datepicker/datepicker-input-base.mjs +3 -3
  82. package/esm2022/datepicker/datepicker-input.mjs +3 -3
  83. package/esm2022/datepicker/datepicker-intl.mjs +3 -3
  84. package/esm2022/datepicker/datepicker-module.mjs +4 -4
  85. package/esm2022/datepicker/datepicker-toggle.mjs +6 -6
  86. package/esm2022/datepicker/datepicker.mjs +3 -3
  87. package/esm2022/datepicker/month-view.mjs +3 -3
  88. package/esm2022/datepicker/multi-year-view.mjs +3 -3
  89. package/esm2022/datepicker/year-view.mjs +3 -3
  90. package/esm2022/dialog/dialog-container.mjs +5 -5
  91. package/esm2022/dialog/dialog-content-directives.mjs +18 -21
  92. package/esm2022/dialog/dialog.mjs +3 -3
  93. package/esm2022/dialog/module.mjs +4 -4
  94. package/esm2022/divider/divider-module.mjs +4 -4
  95. package/esm2022/divider/divider.mjs +3 -3
  96. package/esm2022/expansion/accordion.mjs +4 -5
  97. package/esm2022/expansion/expansion-module.mjs +4 -4
  98. package/esm2022/expansion/expansion-panel-content.mjs +3 -3
  99. package/esm2022/expansion/expansion-panel-header.mjs +9 -9
  100. package/esm2022/expansion/expansion-panel.mjs +8 -8
  101. package/esm2022/form-field/directives/error.mjs +3 -3
  102. package/esm2022/form-field/directives/floating-label.mjs +3 -3
  103. package/esm2022/form-field/directives/hint.mjs +3 -3
  104. package/esm2022/form-field/directives/label.mjs +3 -3
  105. package/esm2022/form-field/directives/line-ripple.mjs +3 -3
  106. package/esm2022/form-field/directives/notched-outline.mjs +3 -3
  107. package/esm2022/form-field/directives/prefix.mjs +3 -3
  108. package/esm2022/form-field/directives/suffix.mjs +3 -3
  109. package/esm2022/form-field/form-field-control.mjs +3 -3
  110. package/esm2022/form-field/form-field.mjs +6 -6
  111. package/esm2022/form-field/module.mjs +4 -4
  112. package/esm2022/grid-list/grid-list-module.mjs +4 -4
  113. package/esm2022/grid-list/grid-list.mjs +3 -3
  114. package/esm2022/grid-list/grid-tile.mjs +15 -15
  115. package/esm2022/icon/icon-module.mjs +4 -4
  116. package/esm2022/icon/icon-registry.mjs +3 -3
  117. package/esm2022/icon/icon.mjs +3 -3
  118. package/esm2022/icon/testing/fake-icon-registry.mjs +7 -7
  119. package/esm2022/input/input.mjs +3 -3
  120. package/esm2022/input/module.mjs +4 -4
  121. package/esm2022/list/action-list.mjs +3 -3
  122. package/esm2022/list/list-base.mjs +6 -6
  123. package/esm2022/list/list-item-sections.mjs +18 -18
  124. package/esm2022/list/list-module.mjs +4 -4
  125. package/esm2022/list/list-option.mjs +6 -6
  126. package/esm2022/list/list.mjs +6 -6
  127. package/esm2022/list/nav-list.mjs +3 -3
  128. package/esm2022/list/selection-list.mjs +3 -3
  129. package/esm2022/list/subheader.mjs +3 -3
  130. package/esm2022/list/tokens.mjs +2 -2
  131. package/esm2022/menu/menu-content.mjs +3 -3
  132. package/esm2022/menu/menu-item.mjs +3 -3
  133. package/esm2022/menu/menu-trigger.mjs +3 -3
  134. package/esm2022/menu/menu.mjs +4 -5
  135. package/esm2022/menu/module.mjs +4 -4
  136. package/esm2022/paginator/module.mjs +4 -4
  137. package/esm2022/paginator/paginator-intl.mjs +3 -3
  138. package/esm2022/paginator/paginator.mjs +5 -5
  139. package/esm2022/progress-bar/module.mjs +4 -4
  140. package/esm2022/progress-bar/progress-bar.mjs +3 -3
  141. package/esm2022/progress-spinner/module.mjs +4 -4
  142. package/esm2022/progress-spinner/progress-spinner.mjs +3 -3
  143. package/esm2022/radio/module.mjs +4 -4
  144. package/esm2022/radio/radio.mjs +6 -6
  145. package/esm2022/select/module.mjs +4 -4
  146. package/esm2022/select/select.mjs +19 -19
  147. package/esm2022/sidenav/drawer.mjs +22 -18
  148. package/esm2022/sidenav/sidenav-module.mjs +4 -4
  149. package/esm2022/sidenav/sidenav.mjs +10 -13
  150. package/esm2022/slide-toggle/module.mjs +8 -8
  151. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +3 -3
  152. package/esm2022/slide-toggle/slide-toggle.mjs +7 -7
  153. package/esm2022/slider/module.mjs +4 -4
  154. package/esm2022/slider/slider-input.mjs +43 -26
  155. package/esm2022/slider/slider-interface.mjs +1 -1
  156. package/esm2022/slider/slider-thumb.mjs +12 -5
  157. package/esm2022/slider/slider.mjs +5 -6
  158. package/esm2022/snack-bar/module.mjs +4 -4
  159. package/esm2022/snack-bar/simple-snack-bar.mjs +3 -3
  160. package/esm2022/snack-bar/snack-bar-container.mjs +13 -12
  161. package/esm2022/snack-bar/snack-bar-content.mjs +9 -9
  162. package/esm2022/snack-bar/snack-bar.mjs +3 -3
  163. package/esm2022/sort/sort-header-intl.mjs +3 -3
  164. package/esm2022/sort/sort-header.mjs +3 -3
  165. package/esm2022/sort/sort-module.mjs +4 -4
  166. package/esm2022/sort/sort.mjs +3 -3
  167. package/esm2022/stepper/step-content.mjs +3 -3
  168. package/esm2022/stepper/step-header.mjs +3 -3
  169. package/esm2022/stepper/step-label.mjs +3 -3
  170. package/esm2022/stepper/stepper-button.mjs +7 -9
  171. package/esm2022/stepper/stepper-icon.mjs +3 -3
  172. package/esm2022/stepper/stepper-intl.mjs +3 -3
  173. package/esm2022/stepper/stepper-module.mjs +4 -4
  174. package/esm2022/stepper/stepper.mjs +16 -12
  175. package/esm2022/table/cell.mjs +21 -21
  176. package/esm2022/table/module.mjs +4 -4
  177. package/esm2022/table/row.mjs +21 -21
  178. package/esm2022/table/table.mjs +64 -31
  179. package/esm2022/table/text-column.mjs +3 -3
  180. package/esm2022/tabs/ink-bar.mjs +4 -4
  181. package/esm2022/tabs/module.mjs +4 -4
  182. package/esm2022/tabs/paginated-tab-header.mjs +13 -6
  183. package/esm2022/tabs/tab-body.mjs +6 -6
  184. package/esm2022/tabs/tab-content.mjs +3 -3
  185. package/esm2022/tabs/tab-group.mjs +10 -8
  186. package/esm2022/tabs/tab-header.mjs +5 -5
  187. package/esm2022/tabs/tab-label-wrapper.mjs +3 -3
  188. package/esm2022/tabs/tab-label.mjs +3 -3
  189. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +11 -11
  190. package/esm2022/tabs/tab.mjs +9 -5
  191. package/esm2022/toolbar/toolbar-module.mjs +4 -4
  192. package/esm2022/toolbar/toolbar.mjs +7 -7
  193. package/esm2022/tooltip/module.mjs +4 -4
  194. package/esm2022/tooltip/tooltip.mjs +6 -6
  195. package/esm2022/tree/node.mjs +9 -9
  196. package/esm2022/tree/outlet.mjs +3 -3
  197. package/esm2022/tree/padding.mjs +3 -3
  198. package/esm2022/tree/toggle.mjs +3 -3
  199. package/esm2022/tree/tree-module.mjs +4 -4
  200. package/esm2022/tree/tree.mjs +3 -3
  201. package/expansion/index.d.ts +2 -2
  202. package/fesm2022/autocomplete.mjs +16 -15
  203. package/fesm2022/autocomplete.mjs.map +1 -1
  204. package/fesm2022/badge.mjs +7 -7
  205. package/fesm2022/bottom-sheet.mjs +12 -13
  206. package/fesm2022/bottom-sheet.mjs.map +1 -1
  207. package/fesm2022/button-toggle.mjs +10 -10
  208. package/fesm2022/button.mjs +40 -40
  209. package/fesm2022/button.mjs.map +1 -1
  210. package/fesm2022/card.mjs +46 -46
  211. package/fesm2022/checkbox.mjs +14 -14
  212. package/fesm2022/chips.mjs +40 -40
  213. package/fesm2022/core.mjs +67 -62
  214. package/fesm2022/core.mjs.map +1 -1
  215. package/fesm2022/datepicker.mjs +86 -86
  216. package/fesm2022/datepicker.mjs.map +1 -1
  217. package/fesm2022/dialog.mjs +28 -31
  218. package/fesm2022/dialog.mjs.map +1 -1
  219. package/fesm2022/divider.mjs +7 -7
  220. package/fesm2022/expansion.mjs +26 -27
  221. package/fesm2022/expansion.mjs.map +1 -1
  222. package/fesm2022/form-field.mjs +36 -36
  223. package/fesm2022/form-field.mjs.map +1 -1
  224. package/fesm2022/grid-list.mjs +22 -22
  225. package/fesm2022/icon/testing.mjs +7 -7
  226. package/fesm2022/icon.mjs +10 -10
  227. package/fesm2022/input.mjs +7 -7
  228. package/fesm2022/list.mjs +52 -52
  229. package/fesm2022/list.mjs.map +1 -1
  230. package/fesm2022/menu.mjs +16 -17
  231. package/fesm2022/menu.mjs.map +1 -1
  232. package/fesm2022/paginator.mjs +11 -11
  233. package/fesm2022/paginator.mjs.map +1 -1
  234. package/fesm2022/progress-bar.mjs +7 -7
  235. package/fesm2022/progress-spinner.mjs +7 -7
  236. package/fesm2022/radio.mjs +10 -10
  237. package/fesm2022/select.mjs +22 -22
  238. package/fesm2022/select.mjs.map +1 -1
  239. package/fesm2022/sidenav.mjs +34 -33
  240. package/fesm2022/sidenav.mjs.map +1 -1
  241. package/fesm2022/slide-toggle.mjs +17 -17
  242. package/fesm2022/slide-toggle.mjs.map +1 -1
  243. package/fesm2022/slider.mjs +60 -38
  244. package/fesm2022/slider.mjs.map +1 -1
  245. package/fesm2022/snack-bar.mjs +32 -30
  246. package/fesm2022/snack-bar.mjs.map +1 -1
  247. package/fesm2022/sort.mjs +13 -13
  248. package/fesm2022/stepper.mjs +40 -38
  249. package/fesm2022/stepper.mjs.map +1 -1
  250. package/fesm2022/table.mjs +111 -78
  251. package/fesm2022/table.mjs.map +1 -1
  252. package/fesm2022/tabs.mjs +64 -52
  253. package/fesm2022/tabs.mjs.map +1 -1
  254. package/fesm2022/toolbar.mjs +11 -11
  255. package/fesm2022/toolbar.mjs.map +1 -1
  256. package/fesm2022/tooltip.mjs +10 -10
  257. package/fesm2022/tree.mjs +25 -25
  258. package/form-field/_form-field-subscript.scss +1 -2
  259. package/form-field/_form-field-theme.scss +4 -2
  260. package/form-field/_mdc-text-field-density-overrides.scss +60 -0
  261. package/icon/_icon-theme.scss +24 -10
  262. package/list/index.d.ts +1 -1
  263. package/package.json +49 -49
  264. package/paginator/_paginator-theme.scss +5 -4
  265. package/prebuilt-themes/deeppurple-amber.css +1 -1
  266. package/prebuilt-themes/indigo-pink.css +1 -1
  267. package/prebuilt-themes/pink-bluegrey.css +1 -1
  268. package/prebuilt-themes/purple-green.css +1 -1
  269. package/schematics/ng-add/index.js +1 -1
  270. package/schematics/ng-add/index.mjs +1 -1
  271. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  272. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  273. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +5 -3
  274. package/schematics/ng-generate/mdc-migration/index_bundled.js +1251 -633
  275. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  276. package/schematics/ng-generate/mdc-migration/schema.json +0 -1
  277. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  278. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  279. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
  280. package/slide-toggle/_slide-toggle-theme.scss +16 -28
  281. package/slide-toggle/index.d.ts +2 -2
  282. package/slider/_slider-theme.scss +10 -12
  283. package/slider/index.d.ts +9 -12
  284. package/snack-bar/index.d.ts +2 -2
  285. package/stepper/index.d.ts +5 -3
  286. package/table/index.d.ts +2 -4
  287. package/tabs/index.d.ts +9 -6
  288. package/form-field/_form-field-density.scss +0 -118
  289. package/form-field/_form-field-sizing.scss +0 -40
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2023 Google LLC.
3
+ Copyright (c) 2024 Google LLC.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/_index.scss CHANGED
@@ -143,12 +143,12 @@
143
143
  tree-base;
144
144
 
145
145
  // MDC Helpers
146
- @forward './core/mdc-helpers/mdc-helpers' as private-* show private-using-mdc-theme,
147
- private-using-mdc-typography, private-disable-mdc-fallback-declarations,
148
- private-typography-config-level-from-mdc, private-if-touch-targets-unsupported,
149
- $private-mdc-base-styles-query, $private-mdc-base-styles-without-animation-query,
150
- $private-mdc-theme-styles-query, $private-mdc-typography-styles-query;
146
+ @forward './core/mdc-helpers/mdc-helpers' as private-* show
147
+ private-disable-mdc-fallback-declarations, private-typography-config-level-from-mdc,
148
+ private-if-touch-targets-unsupported, $private-mdc-base-styles-query,
149
+ $private-mdc-base-styles-without-animation-query, $private-mdc-theme-styles-query,
150
+ $private-mdc-typography-styles-query;
151
151
 
152
152
  // New theming APIs:
153
153
  @forward './core/theming/inspection' show get-theme-version, get-theme-type, get-theme-color,
154
- get-theme-typography, get-theme-density, theme-has;
154
+ get-theme-typography, get-theme-density, theme-has, theme-remove;
@@ -2,7 +2,6 @@ import { AnimationEvent as AnimationEvent_2 } from '@angular/animations';
2
2
  import { AnimationTriggerMetadata } from '@angular/animations';
3
3
  import { BreakpointObserver } from '@angular/cdk/layout';
4
4
  import { CdkDialogContainer } from '@angular/cdk/dialog';
5
- import { ChangeDetectorRef } from '@angular/core';
6
5
  import { ComponentRef } from '@angular/core';
7
6
  import { ComponentType } from '@angular/cdk/portal';
8
7
  import { DialogConfig } from '@angular/cdk/dialog';
@@ -133,7 +132,6 @@ export declare class MatBottomSheetConfig<D = any> {
133
132
  * @docs-private
134
133
  */
135
134
  export declare class MatBottomSheetContainer extends CdkDialogContainer implements OnDestroy {
136
- private _changeDetectorRef;
137
135
  private _breakpointSubscription;
138
136
  /** The state of the bottom sheet animations. */
139
137
  _animationState: 'void' | 'visible' | 'hidden';
@@ -141,7 +139,7 @@ export declare class MatBottomSheetContainer extends CdkDialogContainer implemen
141
139
  _animationStateChanged: EventEmitter<AnimationEvent_2>;
142
140
  /** Whether the component has been destroyed. */
143
141
  private _destroyed;
144
- constructor(elementRef: ElementRef, focusTrapFactory: FocusTrapFactory, document: any, config: DialogConfig, checker: InteractivityChecker, ngZone: NgZone, overlayRef: OverlayRef, breakpointObserver: BreakpointObserver, _changeDetectorRef: ChangeDetectorRef, focusMonitor?: FocusMonitor);
142
+ constructor(elementRef: ElementRef, focusTrapFactory: FocusTrapFactory, document: any, config: DialogConfig, checker: InteractivityChecker, ngZone: NgZone, overlayRef: OverlayRef, breakpointObserver: BreakpointObserver, focusMonitor?: FocusMonitor);
145
143
  /** Begin animation of bottom sheet entrance into view. */
146
144
  enter(): void;
147
145
  /** Begin animation of the bottom sheet exiting from view. */
@@ -151,7 +149,7 @@ export declare class MatBottomSheetContainer extends CdkDialogContainer implemen
151
149
  _onAnimationStart(event: AnimationEvent_2): void;
152
150
  protected _captureInitialFocus(): void;
153
151
  private _toggleClass;
154
- static ɵfac: i0.ɵɵFactoryDeclaration<MatBottomSheetContainer, [null, null, { optional: true; }, null, null, null, null, null, null, null]>;
152
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatBottomSheetContainer, [null, null, { optional: true; }, null, null, null, null, null, null]>;
155
153
  static ɵcmp: i0.ɵɵComponentDeclaration<MatBottomSheetContainer, "mat-bottom-sheet-container", never, {}, {}, never, never, true, never>;
156
154
  }
157
155
 
@@ -119,6 +119,12 @@
119
119
  }
120
120
  }
121
121
 
122
+ // Adds an elevation shadow to a button.
123
+ @mixin mat-private-button-elevation($token-name) {
124
+ // MDC outputs a variable that is the same as the token name, but suffixed with `-shadow`.
125
+ box-shadow: var(#{token-utils.get-token-variable($token-name) + '-shadow'});
126
+ }
127
+
122
128
  @mixin mat-private-button-touch-target($is-square) {
123
129
  // Element used to ensure that the button has a touch target that meets the required minimum.
124
130
  // Note that we use this, instead of MDC's built-in `mdc-button--touch` class, because the MDC
@@ -1,11 +1,10 @@
1
+ @use 'sass:map';
1
2
  @use '@material/button/button-text-theme' as mdc-button-text-theme;
2
3
  @use '@material/button/button-filled-theme' as mdc-button-filled-theme;
3
4
  @use '@material/button/button-protected-theme' as mdc-button-protected-theme;
4
5
  @use '@material/button/button-outlined-theme' as mdc-button-outlined-theme;
5
- @use '@material/elevation/elevation-theme' as mdc-elevation-theme;
6
6
 
7
7
  @use './button-base';
8
- @use '../core/mdc-helpers/mdc-helpers';
9
8
  @use '../core/theming/theming';
10
9
  @use '../core/theming/inspection';
11
10
  @use '../core/tokens/token-utils';
@@ -80,142 +79,177 @@
80
79
  @include token-utils.create-token-values(tokens-mat-outlined-button.$prefix, $mat-tokens);
81
80
  }
82
81
 
83
- @mixin base($theme) {
84
- // TODO(mmalerba): Move button base tokens here
82
+ @mixin _theme-from-tokens($tokens) {
83
+ @if ($tokens != ()) {
84
+ @include mdc-button-text-theme.theme(map.get($tokens, tokens-mdc-text-button.$prefix));
85
+ @include mdc-button-protected-theme.theme(
86
+ map.get($tokens, tokens-mdc-protected-button.$prefix));
87
+ @include mdc-button-filled-theme.theme(map.get($tokens, tokens-mdc-filled-button.$prefix));
88
+ @include mdc-button-outlined-theme.theme(map.get($tokens, tokens-mdc-outlined-button.$prefix));
89
+
90
+ @include token-utils.create-token-values(
91
+ tokens-mat-text-button.$prefix, map.get($tokens, tokens-mat-text-button.$prefix));
92
+ @include token-utils.create-token-values(
93
+ tokens-mat-protected-button.$prefix, map.get($tokens, tokens-mat-protected-button.$prefix));
94
+ @include token-utils.create-token-values(
95
+ tokens-mat-filled-button.$prefix, map.get($tokens, tokens-mat-filled-button.$prefix));
96
+ @include token-utils.create-token-values(
97
+ tokens-mat-outlined-button.$prefix, map.get($tokens, tokens-mat-outlined-button.$prefix));
98
+ }
85
99
  }
86
100
 
87
- @mixin color($theme) {
88
- .mat-mdc-button {
89
- @include _text-button-variant($theme, null);
90
-
91
- &.mat-primary {
92
- @include _text-button-variant($theme, primary);
93
- }
94
-
95
- &.mat-accent {
96
- @include _text-button-variant($theme, accent);
97
- }
98
-
99
- &.mat-warn {
100
- @include _text-button-variant($theme, warn);
101
- }
101
+ @mixin base($theme) {
102
+ @if inspection.get-theme-version($theme) == 1 {
103
+ @include theme-from-tokens(inspection.get-theme-tokens($theme, base));
102
104
  }
103
-
104
- .mat-mdc-unelevated-button {
105
- @include _filled-button-variant($theme, null);
106
-
107
- &.mat-primary {
108
- @include _filled-button-variant($theme, primary);
105
+ @else {
106
+ @include sass-utils.current-selector-or-root() {
107
+ @include mdc-button-text-theme.theme(
108
+ tokens-mdc-text-button.get-unthemable-tokens());
109
+ @include mdc-button-filled-theme.theme(
110
+ tokens-mdc-filled-button.get-unthemable-tokens());
111
+ @include mdc-button-protected-theme.theme(
112
+ tokens-mdc-protected-button.get-unthemable-tokens());
113
+ @include mdc-button-outlined-theme.theme(
114
+ tokens-mdc-outlined-button.get-unthemable-tokens());
109
115
  }
116
+ }
117
+ }
110
118
 
111
- &.mat-accent {
112
- @include _filled-button-variant($theme, accent);
119
+ @mixin color($theme) {
120
+ @if inspection.get-theme-version($theme) == 1 {
121
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
122
+ }
123
+ @else {
124
+ @include sass-utils.current-selector-or-root() {
125
+ @include _text-button-variant($theme, null);
126
+ @include _filled-button-variant($theme, null);
127
+ @include _protected-button-variant($theme, null);
128
+ @include _outlined-button-variant($theme, null);
113
129
  }
114
130
 
115
- &.mat-warn {
116
- @include _filled-button-variant($theme, warn);
117
- }
118
- }
131
+ .mat-mdc-button {
132
+ &.mat-primary {
133
+ @include _text-button-variant($theme, primary);
134
+ }
119
135
 
120
- .mat-mdc-raised-button {
121
- @include _protected-button-variant($theme, null);
136
+ &.mat-accent {
137
+ @include _text-button-variant($theme, accent);
138
+ }
122
139
 
123
- &.mat-primary {
124
- @include _protected-button-variant($theme, primary);
140
+ &.mat-warn {
141
+ @include _text-button-variant($theme, warn);
142
+ }
125
143
  }
126
144
 
127
- &.mat-accent {
128
- @include _protected-button-variant($theme, accent);
129
- }
145
+ .mat-mdc-unelevated-button {
146
+ &.mat-primary {
147
+ @include _filled-button-variant($theme, primary);
148
+ }
130
149
 
131
- &.mat-warn {
132
- @include _protected-button-variant($theme, warn);
150
+ &.mat-accent {
151
+ @include _filled-button-variant($theme, accent);
152
+ }
153
+
154
+ &.mat-warn {
155
+ @include _filled-button-variant($theme, warn);
156
+ }
133
157
  }
134
158
 
135
- // TODO(wagnermaciel): Remove this workaround when b/301126527 is resolved
136
- @include mdc-helpers.disable-mdc-fallback-declarations {
137
- @include mdc-elevation-theme.elevation(2);
159
+ .mat-mdc-raised-button {
160
+ &.mat-primary {
161
+ @include _protected-button-variant($theme, primary);
162
+ }
138
163
 
139
- &:hover, &:focus {
140
- @include mdc-elevation-theme.elevation(4);
164
+ &.mat-accent {
165
+ @include _protected-button-variant($theme, accent);
141
166
  }
142
167
 
143
- &:active, &:focus:active {
144
- @include mdc-elevation-theme.elevation(8);
168
+ &.mat-warn {
169
+ @include _protected-button-variant($theme, warn);
145
170
  }
146
171
  }
147
- }
148
-
149
- .mat-mdc-outlined-button {
150
- @include _outlined-button-variant($theme, null);
151
172
 
152
- &.mat-primary {
153
- @include _outlined-button-variant($theme, primary);
154
- }
173
+ .mat-mdc-outlined-button {
174
+ &.mat-primary {
175
+ @include _outlined-button-variant($theme, primary);
176
+ }
155
177
 
156
- &.mat-accent {
157
- @include _outlined-button-variant($theme, accent);
158
- }
178
+ &.mat-accent {
179
+ @include _outlined-button-variant($theme, accent);
180
+ }
159
181
 
160
- &.mat-warn {
161
- @include _outlined-button-variant($theme, warn);
182
+ &.mat-warn {
183
+ @include _outlined-button-variant($theme, warn);
184
+ }
162
185
  }
163
186
  }
164
187
  }
165
188
 
166
189
  @mixin typography($theme) {
167
- @include sass-utils.current-selector-or-root() {
168
- $text-typography-tokens: tokens-mdc-text-button.get-typography-tokens($theme);
169
- $filled-typography-tokens: tokens-mdc-filled-button.get-typography-tokens($theme);
170
- $outlined-typography-tokens: tokens-mdc-outlined-button.get-typography-tokens($theme);
171
- $protected-typography-tokens: tokens-mdc-protected-button.get-typography-tokens($theme);
172
-
173
- @include mdc-button-text-theme.theme($text-typography-tokens);
174
- @include mdc-button-filled-theme.theme($filled-typography-tokens);
175
- @include mdc-button-outlined-theme.theme($outlined-typography-tokens);
176
- @include mdc-button-protected-theme.theme($protected-typography-tokens);
190
+ @if inspection.get-theme-version($theme) == 1 {
191
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
192
+ }
193
+ @else {
194
+ @include sass-utils.current-selector-or-root() {
195
+ $text-typography-tokens: tokens-mdc-text-button.get-typography-tokens($theme);
196
+ $filled-typography-tokens: tokens-mdc-filled-button.get-typography-tokens($theme);
197
+ $outlined-typography-tokens: tokens-mdc-outlined-button.get-typography-tokens($theme);
198
+ $protected-typography-tokens: tokens-mdc-protected-button.get-typography-tokens($theme);
199
+
200
+ @include mdc-button-text-theme.theme($text-typography-tokens);
201
+ @include mdc-button-filled-theme.theme($filled-typography-tokens);
202
+ @include mdc-button-outlined-theme.theme($outlined-typography-tokens);
203
+ @include mdc-button-protected-theme.theme($protected-typography-tokens);
204
+ }
177
205
  }
178
206
  }
179
207
 
180
208
  @mixin density($theme) {
181
- $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
182
-
183
- .mat-mdc-button {
184
- $density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
185
- @include mdc-button-text-theme.theme($density-tokens);
186
- @include button-base.mat-private-button-touch-target-density($density-scale);
209
+ @if inspection.get-theme-version($theme) == 1 {
210
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
187
211
  }
212
+ @else {
213
+ $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
188
214
 
189
- .mat-mdc-raised-button {
190
- $density-tokens: tokens-mdc-protected-button.get-density-tokens($theme);
191
- @include mdc-button-protected-theme.theme($density-tokens);
192
- @include button-base.mat-private-button-touch-target-density($density-scale);
193
- }
215
+ @include sass-utils.current-selector-or-root() {
216
+ $text-density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
217
+ $filled-density-tokens: tokens-mdc-filled-button.get-density-tokens($theme);
218
+ $outlined-density-tokens: tokens-mdc-outlined-button.get-density-tokens($theme);
219
+ $protected-density-tokens: tokens-mdc-protected-button.get-density-tokens($theme);
194
220
 
195
- .mat-mdc-unelevated-button {
196
- $density-tokens: tokens-mdc-filled-button.get-density-tokens($theme);
197
- @include mdc-button-filled-theme.theme($density-tokens);
198
- @include button-base.mat-private-button-touch-target-density($density-scale);
199
- }
221
+ @include mdc-button-text-theme.theme($text-density-tokens);
222
+ @include mdc-button-filled-theme.theme($filled-density-tokens);
223
+ @include mdc-button-outlined-theme.theme($outlined-density-tokens);
224
+ @include mdc-button-protected-theme.theme($protected-density-tokens);
225
+ }
200
226
 
201
- .mat-mdc-outlined-button {
202
- $density-tokens: tokens-mdc-outlined-button.get-density-tokens($theme);
203
- @include mdc-button-outlined-theme.theme($density-tokens);
204
- @include button-base.mat-private-button-touch-target-density($density-scale);
227
+ .mat-mdc-button,
228
+ .mat-mdc-raised-button,
229
+ .mat-mdc-unelevated-button,
230
+ .mat-mdc-outlined-button {
231
+ // TODO: tokenize the touch target visibility.
232
+ @include button-base.mat-private-button-touch-target-density($density-scale);
233
+ }
205
234
  }
206
235
  }
207
236
 
208
237
  @mixin theme($theme) {
209
238
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-button') {
210
- @include base($theme);
211
- @if inspection.theme-has($theme, color) {
212
- @include color($theme);
213
- }
214
- @if inspection.theme-has($theme, density) {
215
- @include density($theme);
239
+ @if inspection.get-theme-version($theme) == 1 {
240
+ @include _theme-from-tokens(inspection.get-theme-tokens($theme));
216
241
  }
217
- @if inspection.theme-has($theme, typography) {
218
- @include typography($theme);
242
+ @else {
243
+ @include base($theme);
244
+ @if inspection.theme-has($theme, color) {
245
+ @include color($theme);
246
+ }
247
+ @if inspection.theme-has($theme, density) {
248
+ @include density($theme);
249
+ }
250
+ @if inspection.theme-has($theme, typography) {
251
+ @include typography($theme);
252
+ }
219
253
  }
220
254
  }
221
255
  }
@@ -47,6 +47,7 @@
47
47
  @else {
48
48
  @include sass-utils.current-selector-or-root() {
49
49
  @include _fab-variant($theme, null);
50
+ @include mdc-extended-fab-theme.theme(tokens-mdc-extended-fab.get-color-tokens($theme));
50
51
 
51
52
  .mat-mdc-fab,
52
53
  .mat-mdc-mini-fab {
@@ -43,19 +43,21 @@
43
43
  @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
44
44
  }
45
45
  @else {
46
- .mat-mdc-icon-button {
46
+ @include sass-utils.current-selector-or-root() {
47
47
  @include _icon-button-variant($theme, null);
48
48
 
49
- &.mat-primary {
50
- @include _icon-button-variant($theme, primary);
51
- }
49
+ .mat-mdc-icon-button {
50
+ &.mat-primary {
51
+ @include _icon-button-variant($theme, primary);
52
+ }
52
53
 
53
- &.mat-accent {
54
- @include _icon-button-variant($theme, accent);
55
- }
54
+ &.mat-accent {
55
+ @include _icon-button-variant($theme, accent);
56
+ }
56
57
 
57
- &.mat-warn {
58
- @include _icon-button-variant($theme, warn);
58
+ &.mat-warn {
59
+ @include _icon-button-variant($theme, warn);
60
+ }
59
61
  }
60
62
  }
61
63
  }
@@ -6,7 +6,10 @@
6
6
  @use './option/optgroup-theme';
7
7
  @use './selection/pseudo-checkbox/pseudo-checkbox-theme';
8
8
  @use './style/elevation';
9
+ @use './style/sass-utils';
9
10
  @use './typography/typography';
11
+ @use './tokens/token-utils';
12
+ @use './tokens/m2/mat/app' as tokens-mat-app;
10
13
 
11
14
  @mixin base($theme) {
12
15
  @include ripple-theme.base($theme);
@@ -21,13 +24,9 @@
21
24
  @include option-theme.color($theme);
22
25
  @include optgroup-theme.color($theme);
23
26
  @include pseudo-checkbox-theme.color($theme);
24
-
25
- // Wrapper element that provides the theme background when the user's content isn't
26
- // inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand
27
- // selector in case the mixin is included at the top level.
28
- .mat-app-background#{if(&, ', &.mat-app-background', '')} {
29
- background-color: inspection.get-theme-color($theme, background, background);
30
- color: inspection.get-theme-color($theme, foreground, text);
27
+ @include sass-utils.current-selector-or-root() {
28
+ @include token-utils.create-token-values(tokens-mat-app.$prefix,
29
+ tokens-mat-app.get-color-tokens($theme));
31
30
  }
32
31
 
33
32
  // Provides external CSS classes for each elevation value. Each CSS class is formatted as
package/core/_core.scss CHANGED
@@ -1,8 +1,9 @@
1
1
  @use '@angular/cdk';
2
-
3
- // Core styles that can be used to apply material design treatments to any element.
2
+ @use './tokens/m2/mat/app' as tokens-mat-app;
3
+ @use './tokens/token-utils';
4
4
  @use './ripple/ripple';
5
5
  @use './focus-indicators/private';
6
+ @use './mdc-helpers/mdc-helpers';
6
7
 
7
8
  // Mixin that renders all of the core styles that are not theme-dependent.
8
9
  @mixin core() {
@@ -13,4 +14,18 @@
13
14
  @include cdk.text-field-autofill();
14
15
  @include private.structural-styling('mat');
15
16
  @include private.structural-styling('mat-mdc');
17
+
18
+ // Wrapper element that provides the theme background when the
19
+ // user's content isn't inside of a `mat-sidenav-container`.
20
+ @at-root {
21
+ .mat-app-background {
22
+ @include mdc-helpers.disable-mdc-fallback-declarations {
23
+ @include token-utils.use-tokens(tokens-mat-app.$prefix, tokens-mat-app.get-token-slots()) {
24
+ // Note: we need to emit fallback values here to avoid errors in internal builds.
25
+ @include token-utils.create-token-slot(background-color, background-color, transparent);
26
+ @include token-utils.create-token-slot(color, text-color, inherit);
27
+ }
28
+ }
29
+ }
30
+ }
16
31
  }
package/core/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import { Observable } from 'rxjs';
17
17
  import { OnDestroy } from '@angular/core';
18
18
  import { OnInit } from '@angular/core';
19
19
  import { Platform } from '@angular/cdk/platform';
20
+ import { Provider } from '@angular/core';
20
21
  import { QueryList } from '@angular/core';
21
22
  import { Subject } from 'rxjs';
22
23
  import { Version } from '@angular/core';
@@ -549,7 +550,7 @@ export declare class MatLineModule {
549
550
 
550
551
  export declare class MatNativeDateModule {
551
552
  static ɵfac: i0.ɵɵFactoryDeclaration<MatNativeDateModule, never>;
552
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatNativeDateModule, never, [typeof NativeDateModule], never>;
553
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MatNativeDateModule, never, never, never>;
553
554
  static ɵinj: i0.ɵɵInjectorDeclaration<MatNativeDateModule>;
554
555
  }
555
556
 
@@ -952,6 +953,8 @@ export declare class NativeDateModule {
952
953
  static ɵinj: i0.ɵɵInjectorDeclaration<NativeDateModule>;
953
954
  }
954
955
 
956
+ export declare function provideNativeDateAdapter(formats?: MatDateFormats): Provider[];
957
+
955
958
  /**
956
959
  * Interface that describes the configuration for the animation of a ripple.
957
960
  * There are two animation phases with different durations for the ripples.