@angular/material 16.2.0-next.2 → 16.2.0-next.4

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 (87) hide show
  1. package/autocomplete/index.d.ts +34 -4
  2. package/button/_fab-theme.scss +70 -43
  3. package/card/_card-theme.scss +20 -4
  4. package/checkbox/_checkbox-theme.scss +5 -3
  5. package/core/index.d.ts +2 -2
  6. package/core/tokens/_token-utils.scss +14 -0
  7. package/core/tokens/m2/mat/_expansion.scss +90 -0
  8. package/core/tokens/m2/mat/_menu.scss +62 -0
  9. package/core/tokens/m2/mat/_stepper.scss +118 -0
  10. package/core/tokens/m2/mdc/_extended-fab.scss +88 -0
  11. package/core/tokens/m2/mdc/_fab.scss +89 -0
  12. package/core/typography/_typography-utils.scss +13 -0
  13. package/esm2022/autocomplete/autocomplete-trigger.mjs +85 -38
  14. package/esm2022/autocomplete/autocomplete.mjs +25 -4
  15. package/esm2022/button/fab.mjs +8 -8
  16. package/esm2022/button-toggle/button-toggle.mjs +2 -1
  17. package/esm2022/chips/chip-set.mjs +2 -2
  18. package/esm2022/core/option/option.mjs +9 -5
  19. package/esm2022/core/version.mjs +1 -1
  20. package/esm2022/expansion/expansion-animations.mjs +5 -2
  21. package/esm2022/expansion/expansion-panel-header.mjs +3 -3
  22. package/esm2022/expansion/expansion-panel.mjs +3 -3
  23. package/esm2022/legacy-autocomplete/autocomplete.mjs +2 -1
  24. package/esm2022/legacy-dialog/testing/dialog-opener.mjs +6 -1
  25. package/esm2022/legacy-menu/menu.mjs +4 -2
  26. package/esm2022/legacy-table/text-column.mjs +6 -2
  27. package/esm2022/legacy-tabs/tab.mjs +6 -3
  28. package/esm2022/legacy-tooltip/tooltip.mjs +5 -2
  29. package/esm2022/menu/menu-item.mjs +4 -4
  30. package/esm2022/menu/menu.mjs +3 -3
  31. package/esm2022/sidenav/drawer.mjs +15 -13
  32. package/esm2022/stepper/step-header.mjs +2 -2
  33. package/esm2022/stepper/stepper.mjs +3 -3
  34. package/expansion/_expansion-legacy-index.scss +0 -1
  35. package/expansion/_expansion-theme.import.scss +0 -2
  36. package/expansion/_expansion-theme.scss +12 -68
  37. package/fesm2022/autocomplete.mjs +109 -41
  38. package/fesm2022/autocomplete.mjs.map +1 -1
  39. package/fesm2022/button-toggle.mjs +1 -0
  40. package/fesm2022/button-toggle.mjs.map +1 -1
  41. package/fesm2022/button.mjs +8 -8
  42. package/fesm2022/button.mjs.map +1 -1
  43. package/fesm2022/chips.mjs +1 -1
  44. package/fesm2022/chips.mjs.map +1 -1
  45. package/fesm2022/core.mjs +9 -5
  46. package/fesm2022/core.mjs.map +1 -1
  47. package/fesm2022/expansion.mjs +8 -5
  48. package/fesm2022/expansion.mjs.map +1 -1
  49. package/fesm2022/legacy-autocomplete.mjs +1 -0
  50. package/fesm2022/legacy-autocomplete.mjs.map +1 -1
  51. package/fesm2022/legacy-dialog/testing.mjs +5 -0
  52. package/fesm2022/legacy-dialog/testing.mjs.map +1 -1
  53. package/fesm2022/legacy-menu.mjs +3 -1
  54. package/fesm2022/legacy-menu.mjs.map +1 -1
  55. package/fesm2022/legacy-table.mjs +5 -1
  56. package/fesm2022/legacy-table.mjs.map +1 -1
  57. package/fesm2022/legacy-tabs.mjs +5 -2
  58. package/fesm2022/legacy-tabs.mjs.map +1 -1
  59. package/fesm2022/legacy-tooltip.mjs +4 -1
  60. package/fesm2022/legacy-tooltip.mjs.map +1 -1
  61. package/fesm2022/menu.mjs +5 -5
  62. package/fesm2022/menu.mjs.map +1 -1
  63. package/fesm2022/sidenav.mjs +14 -12
  64. package/fesm2022/sidenav.mjs.map +1 -1
  65. package/fesm2022/stepper.mjs +4 -4
  66. package/fesm2022/stepper.mjs.map +1 -1
  67. package/legacy-autocomplete/index.d.ts +1 -0
  68. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  69. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  70. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  71. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  72. package/menu/_menu-theme.scss +9 -52
  73. package/menu/index.d.ts +1 -1
  74. package/package.json +2 -2
  75. package/prebuilt-themes/deeppurple-amber.css +1 -1
  76. package/prebuilt-themes/indigo-pink.css +1 -1
  77. package/prebuilt-themes/pink-bluegrey.css +1 -1
  78. package/prebuilt-themes/purple-green.css +1 -1
  79. package/schematics/ng-add/index.js +1 -1
  80. package/schematics/ng-add/index.mjs +1 -1
  81. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  82. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  83. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -5
  84. package/sidenav/index.d.ts +1 -1
  85. package/stepper/_stepper-theme.scss +18 -147
  86. package/expansion/_expansion-mixins.import.scss +0 -1
  87. package/expansion/_expansion-mixins.scss +0 -11
@@ -0,0 +1,88 @@
1
+ @use '../../../mdc-helpers/mdc-helpers';
2
+ @use '../../token-utils';
3
+ @use '../../../typography/typography-utils';
4
+
5
+ @use 'sass:map';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mdc, extended-fab);
9
+
10
+ @function get-unthemable-tokens() {
11
+ @return (
12
+ container-color: null,
13
+ container-elevation: null,
14
+ container-height: null,
15
+ container-shadow-color: null,
16
+ container-shape: null,
17
+ container-surface-tint-layer-color: null,
18
+ focus-container-elevation: null,
19
+ focus-icon-color: null,
20
+ focus-label-text-color: null,
21
+ focus-outline-color: null,
22
+ focus-outline-width: null,
23
+ focus-state-layer-color: null,
24
+ focus-state-layer-opacity: null,
25
+ hover-container-elevation: null,
26
+ hover-icon-color: null,
27
+ hover-label-text-color: null,
28
+ hover-state-layer-color: null,
29
+ hover-state-layer-opacity: null,
30
+ icon-color: null,
31
+ icon-size: null,
32
+ label-text-color: null,
33
+ lowered-container-elevation: null,
34
+ lowered-focus-container-elevation: null,
35
+ lowered-hover-container-elevation: null,
36
+ lowered-pressed-container-elevation: null,
37
+ pressed-container-elevation: null,
38
+ pressed-icon-color: null,
39
+ pressed-label-text-color: null,
40
+ pressed-ripple-color: null,
41
+ pressed-ripple-opacity: null,
42
+ pressed-state-layer-color: null,
43
+ pressed-state-layer-opacity: null
44
+ );
45
+ }
46
+
47
+ // Tokens that can be configured through Angular Material's color theming API.
48
+ @function get-color-tokens($config) {
49
+ @return ();
50
+ }
51
+
52
+ // Tokens that can be configured through Angular Material's typography theming API.
53
+ @function get-typography-tokens($config) {
54
+ // TODO(wagnermaciel): The earlier implementation of the snack bar used MDC's APIs to create the
55
+ // typography tokens. As a result, we unintentionally allowed `null` typography configs to be
56
+ // passed in. Since there a lot of apps that now depend on this pattern, we need this temporary
57
+ // fallback.
58
+ @if ($config == null) {
59
+ $config: mdc-helpers.private-fallback-typography-from-mdc();
60
+ }
61
+ @return (
62
+ label-text-font: typography-utils.font-family($config, button) or
63
+ typography-utils.font-family($config),
64
+ label-text-size: typography-utils.font-size($config, button),
65
+ label-text-tracking: typography-utils.letter-spacing($config, button),
66
+ label-text-weight: typography-utils.font-weight($config, button)
67
+ );
68
+ }
69
+
70
+ // Tokens that can be configured through Angular Material's density theming API.
71
+ @function get-density-tokens($config) {
72
+ @return ();
73
+ }
74
+
75
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
76
+ // This is used to create token slots.
77
+ @function get-token-slots() {
78
+ @return map.merge(
79
+ get-unthemable-tokens(),
80
+ map.merge(
81
+ get-color-tokens(token-utils.$placeholder-color-config),
82
+ map.merge(
83
+ get-typography-tokens(token-utils.$placeholder-typography-config),
84
+ get-density-tokens(token-utils.$placeholder-density-config)
85
+ )
86
+ )
87
+ );
88
+ }
@@ -0,0 +1,89 @@
1
+ @use '../../../theming/theming';
2
+ @use '../../token-utils';
3
+
4
+ @use 'sass:map';
5
+
6
+ // The prefix used to generate the fully qualified name for tokens in this file.
7
+ $prefix: (mdc, fab);
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
+ //
12
+ // Tokens that are available in MDC, but not used in Angular Material should be mapped to `null`.
13
+ // `null` indicates that we are intentionally choosing not to emit a slot or value for the token in
14
+ // our CSS.
15
+ $height: 56px;
16
+ $mini-height: 40px;
17
+ $shape-radius: 50%;
18
+ $ripple-target: '.mdc-fab__ripple';
19
+
20
+ @function get-unthemable-tokens() {
21
+ @return (
22
+ container-shape: 50%,
23
+ icon-size: 24px,
24
+
25
+ container-elevation: null,
26
+ container-height: null,
27
+ container-shadow-color: null,
28
+ container-surface-tint-layer-color: null,
29
+ container-width: null,
30
+
31
+ focus-container-elevation: null,
32
+ focus-icon-color: null,
33
+ focus-outline-color: null,
34
+ focus-outline-width: null,
35
+ focus-state-layer-color: null,
36
+ focus-state-layer-opacity: null,
37
+
38
+ hover-container-elevation: null,
39
+ hover-icon-color: null,
40
+ hover-state-layer-color: null,
41
+ hover-state-layer-opacity: null,
42
+
43
+ lowered-container-elevation: null,
44
+ lowered-focus-container-elevation: null,
45
+ lowered-hover-container-elevation: null,
46
+ lowered-pressed-container-elevation: null,
47
+
48
+ pressed-container-elevation: null,
49
+ pressed-icon-color: null,
50
+ pressed-ripple-color: null,
51
+ pressed-ripple-opacity: null,
52
+ pressed-state-layer-color: null,
53
+ pressed-state-layer-opacity: null
54
+ );
55
+ }
56
+
57
+ // Tokens that can be configured through Angular Material's color theming API.
58
+ @function get-color-tokens($config) {
59
+ $primary: map.get($config, primary);
60
+ $surface: theming.get-color-from-palette($primary, default);
61
+ $on-surface: theming.get-color-from-palette($primary, default-contrast);
62
+
63
+ @return (container-color: $surface, icon-color: $on-surface);
64
+ }
65
+
66
+ // Tokens that can be configured through Angular Material's typography theming API.
67
+ @function get-typography-tokens($config) {
68
+ @return ();
69
+ }
70
+
71
+ // Tokens that can be configured through Angular Material's density theming API.
72
+ @function get-density-tokens($config) {
73
+ @return ();
74
+ }
75
+
76
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
77
+ // This is used to create token slots.
78
+ @function get-token-slots() {
79
+ @return map.merge(
80
+ get-unthemable-tokens(),
81
+ map.merge(
82
+ get-color-tokens(token-utils.$placeholder-color-config),
83
+ map.merge(
84
+ get-typography-tokens(token-utils.$placeholder-typography-config),
85
+ get-density-tokens(token-utils.$placeholder-density-config)
86
+ )
87
+ )
88
+ );
89
+ }
@@ -7,6 +7,15 @@
7
7
 
8
8
  // Utility for fetching a nested value from a typography config.
9
9
  @function _mat-get-type-value($config, $level, $name) {
10
+ @if meta.type-of($config) != 'map' {
11
+ @error 'Typography config must be a map. Received #{meta.type-of($config)}.';
12
+ }
13
+
14
+ @if not map.has-key($config, $level) {
15
+ @error 'Typography config does not have a level called "#{$level}". ' +
16
+ 'Available levels are: #{map.keys($config)}.';
17
+ }
18
+
10
19
  @return map.get(map.get($config, $level), $name);
11
20
  }
12
21
 
@@ -42,6 +51,10 @@
42
51
  /// @param {Map} $config A typography config.
43
52
  /// @param {Map} $level A typography level.
44
53
  @function font-family($config, $level: null) {
54
+ @if meta.type-of($config) != 'map' {
55
+ @error 'Typography config must be a map. Received #{meta.type-of($config)}.';
56
+ }
57
+
45
58
  $font-family: map.get($config, font-family);
46
59
 
47
60
  @if $level != null {