@angular/material 16.2.0-next.3 → 16.2.0-next.5

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 (120) hide show
  1. package/autocomplete/index.d.ts +34 -4
  2. package/badge/_badge-theme.scss +84 -118
  3. package/bottom-sheet/_bottom-sheet-theme.scss +10 -11
  4. package/button/_fab-theme.scss +70 -43
  5. package/button-toggle/_button-toggle-theme.scss +20 -97
  6. package/button-toggle/_button-toggle-variables.scss +2 -0
  7. package/card/_card-theme.scss +20 -4
  8. package/checkbox/_checkbox-theme.scss +5 -3
  9. package/chips/index.d.ts +11 -4
  10. package/core/index.d.ts +3 -2
  11. package/core/tokens/_token-utils.scss +2 -0
  12. package/core/tokens/m2/mat/_badge.scss +78 -0
  13. package/core/tokens/m2/mat/_bottom-sheet.scss +56 -0
  14. package/core/tokens/m2/mat/_datepicker.scss +184 -0
  15. package/core/tokens/m2/mat/_divider.scss +45 -0
  16. package/core/tokens/m2/mat/_expansion.scss +90 -0
  17. package/core/tokens/m2/mat/_legacy-button-toggle.scss +63 -0
  18. package/core/tokens/m2/mat/_sidenav.scss +65 -0
  19. package/core/tokens/m2/mat/_standard-button-toggle.scss +87 -0
  20. package/core/tokens/m2/mat/_toolbar.scss +79 -0
  21. package/core/tokens/m2/mdc/_extended-fab.scss +88 -0
  22. package/core/tokens/m2/mdc/_fab.scss +89 -0
  23. package/datepicker/_datepicker-theme.scss +44 -203
  24. package/divider/_divider-theme.scss +6 -8
  25. package/esm2022/autocomplete/autocomplete-trigger.mjs +85 -38
  26. package/esm2022/autocomplete/autocomplete.mjs +25 -4
  27. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  28. package/esm2022/button/fab.mjs +8 -8
  29. package/esm2022/button-toggle/button-toggle.mjs +2 -2
  30. package/esm2022/chips/chip-option.mjs +4 -5
  31. package/esm2022/chips/chip-row.mjs +15 -10
  32. package/esm2022/chips/chip.mjs +29 -12
  33. package/esm2022/core/option/option.mjs +9 -5
  34. package/esm2022/core/private/ripple-loader.mjs +4 -1
  35. package/esm2022/core/version.mjs +1 -1
  36. package/esm2022/datepicker/calendar-body.mjs +2 -2
  37. package/esm2022/datepicker/calendar.mjs +2 -2
  38. package/esm2022/datepicker/date-range-input.mjs +2 -2
  39. package/esm2022/datepicker/datepicker-base.mjs +3 -3
  40. package/esm2022/datepicker/datepicker-toggle.mjs +2 -2
  41. package/esm2022/divider/divider.mjs +2 -2
  42. package/esm2022/expansion/expansion-animations.mjs +5 -2
  43. package/esm2022/expansion/expansion-panel-header.mjs +3 -3
  44. package/esm2022/expansion/expansion-panel.mjs +3 -3
  45. package/esm2022/form-field/form-field.mjs +3 -3
  46. package/esm2022/legacy-autocomplete/autocomplete.mjs +2 -1
  47. package/esm2022/legacy-dialog/testing/dialog-opener.mjs +6 -1
  48. package/esm2022/legacy-menu/menu.mjs +4 -2
  49. package/esm2022/legacy-table/text-column.mjs +6 -2
  50. package/esm2022/legacy-tabs/tab.mjs +6 -3
  51. package/esm2022/legacy-tooltip/tooltip.mjs +5 -2
  52. package/esm2022/menu/menu-item.mjs +4 -4
  53. package/esm2022/menu/menu.mjs +3 -3
  54. package/esm2022/radio/radio.mjs +13 -1
  55. package/esm2022/sidenav/drawer.mjs +3 -3
  56. package/esm2022/sidenav/sidenav.mjs +3 -3
  57. package/esm2022/slide-toggle/slide-toggle.mjs +2 -2
  58. package/esm2022/toolbar/toolbar.mjs +2 -2
  59. package/expansion/_expansion-legacy-index.scss +0 -1
  60. package/expansion/_expansion-theme.import.scss +0 -2
  61. package/expansion/_expansion-theme.scss +12 -68
  62. package/fesm2022/autocomplete.mjs +109 -41
  63. package/fesm2022/autocomplete.mjs.map +1 -1
  64. package/fesm2022/bottom-sheet.mjs +2 -2
  65. package/fesm2022/bottom-sheet.mjs.map +1 -1
  66. package/fesm2022/button-toggle.mjs +2 -2
  67. package/fesm2022/button-toggle.mjs.map +1 -1
  68. package/fesm2022/button.mjs +8 -8
  69. package/fesm2022/button.mjs.map +1 -1
  70. package/fesm2022/chips.mjs +41 -17
  71. package/fesm2022/chips.mjs.map +1 -1
  72. package/fesm2022/core.mjs +12 -5
  73. package/fesm2022/core.mjs.map +1 -1
  74. package/fesm2022/datepicker.mjs +10 -10
  75. package/fesm2022/datepicker.mjs.map +1 -1
  76. package/fesm2022/divider.mjs +2 -2
  77. package/fesm2022/divider.mjs.map +1 -1
  78. package/fesm2022/expansion.mjs +8 -5
  79. package/fesm2022/expansion.mjs.map +1 -1
  80. package/fesm2022/form-field.mjs +2 -2
  81. package/fesm2022/form-field.mjs.map +1 -1
  82. package/fesm2022/legacy-autocomplete.mjs +1 -0
  83. package/fesm2022/legacy-autocomplete.mjs.map +1 -1
  84. package/fesm2022/legacy-dialog/testing.mjs +5 -0
  85. package/fesm2022/legacy-dialog/testing.mjs.map +1 -1
  86. package/fesm2022/legacy-menu.mjs +3 -1
  87. package/fesm2022/legacy-menu.mjs.map +1 -1
  88. package/fesm2022/legacy-table.mjs +5 -1
  89. package/fesm2022/legacy-table.mjs.map +1 -1
  90. package/fesm2022/legacy-tabs.mjs +5 -2
  91. package/fesm2022/legacy-tabs.mjs.map +1 -1
  92. package/fesm2022/legacy-tooltip.mjs +4 -1
  93. package/fesm2022/legacy-tooltip.mjs.map +1 -1
  94. package/fesm2022/menu.mjs +5 -5
  95. package/fesm2022/menu.mjs.map +1 -1
  96. package/fesm2022/radio.mjs +12 -0
  97. package/fesm2022/radio.mjs.map +1 -1
  98. package/fesm2022/sidenav.mjs +4 -4
  99. package/fesm2022/sidenav.mjs.map +1 -1
  100. package/fesm2022/slide-toggle.mjs +2 -2
  101. package/fesm2022/slide-toggle.mjs.map +1 -1
  102. package/fesm2022/toolbar.mjs +2 -2
  103. package/fesm2022/toolbar.mjs.map +1 -1
  104. package/legacy-autocomplete/index.d.ts +1 -0
  105. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  106. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  107. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  108. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  109. package/package.json +2 -2
  110. package/prebuilt-themes/deeppurple-amber.css +1 -1
  111. package/prebuilt-themes/indigo-pink.css +1 -1
  112. package/prebuilt-themes/pink-bluegrey.css +1 -1
  113. package/prebuilt-themes/purple-green.css +1 -1
  114. package/radio/index.d.ts +4 -1
  115. package/schematics/ng-add/index.js +1 -1
  116. package/schematics/ng-add/index.mjs +1 -1
  117. package/sidenav/_sidenav-theme.scss +6 -69
  118. package/toolbar/_toolbar-theme.scss +25 -71
  119. package/expansion/_expansion-mixins.import.scss +0 -1
  120. package/expansion/_expansion-mixins.scss +0 -11
@@ -0,0 +1,90 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../theming/theming';
4
+ @use '../../../style/sass-utils';
5
+ @use '../../../typography/typography-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, expansion);
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
+ container-shape: 4px,
15
+ );
16
+ }
17
+
18
+ // Tokens that can be configured through Angular Material's color theming API.
19
+ @function get-color-tokens($config) {
20
+ $foreground: map.get($config, foreground);
21
+ $background: map.get($config, background);
22
+
23
+ @return (
24
+ container-background-color: theming.get-color-from-palette($background, card),
25
+ container-text-color: theming.get-color-from-palette($foreground, text),
26
+ actions-divider-color: theming.get-color-from-palette($foreground, divider),
27
+ header-hover-state-layer-color: theming.get-color-from-palette($background, hover),
28
+ header-focus-state-layer-color: theming.get-color-from-palette($background, hover),
29
+ header-disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
30
+ header-text-color: theming.get-color-from-palette($foreground, text),
31
+ header-description-color: theming.get-color-from-palette($foreground, secondary-text),
32
+ header-indicator-color: theming.get-color-from-palette($foreground, secondary-text),
33
+ );
34
+ }
35
+
36
+ // Tokens that can be configured through Angular Material's typography theming API.
37
+ @function get-typography-tokens($config) {
38
+ $fallback-font-family: typography-utils.font-family($config);
39
+
40
+ @return (
41
+ header-text-font: typography-utils.font-family($config, subheading-1) or $fallback-font-family,
42
+ header-text-size: typography-utils.font-size($config, subheading-1),
43
+ header-text-weight: typography-utils.font-weight($config, subheading-1),
44
+
45
+ // TODO(crisbeto): these two properties weren't set at all before the introduction of tokens,
46
+ // but it's inconsistent not to provide them since the container sets all of them. Eventually
47
+ // we should change the values to use come from `subheading-1`.
48
+ header-text-line-height: inherit,
49
+ header-text-tracking: inherit,
50
+
51
+ container-text-font: typography-utils.font-family($config, body-1) or $fallback-font-family,
52
+ container-text-line-height: typography-utils.line-height($config, body-1),
53
+ container-text-size: typography-utils.font-size($config, body-1),
54
+ container-text-tracking: typography-utils.letter-spacing($config, body-1),
55
+ container-text-weight: typography-utils.font-weight($config, body-1),
56
+ );
57
+ }
58
+
59
+ // Tokens that can be configured through Angular Material's density theming API.
60
+ @function get-density-tokens($config) {
61
+ $scale: theming.clamp-density($config, -3);
62
+ $collapsed-scale: (
63
+ 0: 48px,
64
+ -1: 44px,
65
+ -2: 40px,
66
+ -3: 36px,
67
+ );
68
+ $expanded-scale: (
69
+ 0: 64px,
70
+ -1: 60px,
71
+ -2: 56px,
72
+ -3: 48px,
73
+ );
74
+
75
+ @return (
76
+ header-collapsed-state-height: map.get($collapsed-scale, $scale),
77
+ header-expanded-state-height: map.get($expanded-scale, $scale),
78
+ );
79
+ }
80
+
81
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
82
+ // This is used to create token slots.
83
+ @function get-token-slots() {
84
+ @return sass-utils.deep-merge-all(
85
+ get-unthemable-tokens(),
86
+ get-color-tokens(token-utils.$placeholder-color-config),
87
+ get-typography-tokens(token-utils.$placeholder-typography-config),
88
+ get-density-tokens(token-utils.$placeholder-density-config)
89
+ );
90
+ }
@@ -0,0 +1,63 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../typography/typography-utils';
4
+ @use '../../../theming/theming';
5
+ @use '../../../style/sass-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, legacy-button-toggle);
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
+ height: 36px,
15
+ shape: 2px,
16
+ focus-state-layer-opacity: 1,
17
+ );
18
+ }
19
+
20
+ // Tokens that can be configured through Angular Material's color theming API.
21
+ @function get-color-tokens($config) {
22
+ $foreground: map.get($config, foreground);
23
+ $background: map.get($config, background);
24
+
25
+ @return (
26
+ text-color: theming.get-color-from-palette($foreground, hint-text),
27
+ state-layer-color: theming.get-color-from-palette($background, focused-button),
28
+ selected-state-text-color: theming.get-color-from-palette($foreground, secondary-text),
29
+ selected-state-background-color: theming.get-color-from-palette($background, selected-button),
30
+ disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
31
+ disabled-state-background-color:
32
+ theming.get-color-from-palette($background, disabled-button-toggle),
33
+ disabled-selected-state-background-color:
34
+ theming.get-color-from-palette($background, selected-disabled-button)
35
+ );
36
+ }
37
+
38
+ // Tokens that can be configured through Angular Material's typography theming API.
39
+ @function get-typography-tokens($config) {
40
+ @return (
41
+ // TODO(crisbeto): other components have tokens for all typography dimensions (font weight,
42
+ // letter spacing etc). The button toggle only has the font to match what it had in the
43
+ // old theming API and to reduce internal breakages. We should introduce more typography
44
+ // tokens at some point.
45
+ text-font: typography-utils.font-family($config),
46
+ );
47
+ }
48
+
49
+ // Tokens that can be configured through Angular Material's density theming API.
50
+ @function get-density-tokens($config) {
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
+ }
@@ -0,0 +1,65 @@
1
+ @use 'sass:color';
2
+ @use 'sass:map';
3
+ @use 'sass:meta';
4
+ @use '../../token-utils';
5
+ @use '../../../theming/theming';
6
+ @use '../../../style/sass-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, sidenav);
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
+ // Currently zero, but it appears to be relevant for M3.
16
+ // See: https://m3.material.io/components/navigation-drawer/overview
17
+ container-shape: 0,
18
+ );
19
+ }
20
+
21
+ // Tokens that can be configured through Angular Material's color theming API.
22
+ @function get-color-tokens($config) {
23
+ $is-dark: map.get($config, is-dark);
24
+ $foreground: map.get($config, foreground);
25
+ $background: map.get($config, background);
26
+ $scrim-opacity: 0.6;
27
+ $scrim-color: theming.get-color-from-palette($background, card, $scrim-opacity);
28
+ $fallback-scrim-color: if($is-dark, rgba(#fff, $scrim-opacity), rgba(#000, $scrim-opacity));
29
+
30
+ @return (
31
+ container-divider-color: theming.get-color-from-palette($foreground, divider),
32
+ container-background-color: theming.get-color-from-palette($background, dialog),
33
+ container-text-color: theming.get-color-from-palette($foreground, text),
34
+ content-background-color: theming.get-color-from-palette($background, background),
35
+ content-text-color: theming.get-color-from-palette($foreground, text),
36
+
37
+ // We use invert() here to have the darken the background color expected to be used.
38
+ // If the background is light, we use a dark backdrop. If the background is dark, we
39
+ // use a light backdrop. If the value isn't a color, Sass will throw an error so we
40
+ // fall back to something generic.
41
+ scrim-color: if(meta.type-of($scrim-color) == color,
42
+ color.invert($scrim-color), $fallback-scrim-color),
43
+ );
44
+ }
45
+
46
+ // Tokens that can be configured through Angular Material's typography theming API.
47
+ @function get-typography-tokens($config) {
48
+ @return ();
49
+ }
50
+
51
+ // Tokens that can be configured through Angular Material's density theming API.
52
+ @function get-density-tokens($config) {
53
+ @return ();
54
+ }
55
+
56
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
57
+ // This is used to create token slots.
58
+ @function get-token-slots() {
59
+ @return sass-utils.deep-merge-all(
60
+ get-unthemable-tokens(),
61
+ get-color-tokens(token-utils.$placeholder-color-config),
62
+ get-typography-tokens(token-utils.$placeholder-typography-config),
63
+ get-density-tokens(token-utils.$placeholder-density-config)
64
+ );
65
+ }
@@ -0,0 +1,87 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '../../token-utils';
4
+ @use '../../../typography/typography-utils';
5
+ @use '../../../theming/theming';
6
+ @use '../../../style/sass-utils';
7
+
8
+ // The prefix used to generate the fully qualified name for tokens in this file.
9
+ $prefix: (mat, standard-button-toggle);
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
+ shape: 4px,
16
+ hover-state-layer-opacity: 0.04,
17
+ focus-state-layer-opacity: 0.12,
18
+ );
19
+ }
20
+
21
+ // Tokens that can be configured through Angular Material's color theming API.
22
+ @function get-color-tokens($config) {
23
+ $foreground: map.get($config, foreground);
24
+ $background: map.get($config, background);
25
+ $theme-divider-color: theming.get-color-from-palette($foreground, divider);
26
+
27
+ // By default the theme usually has an rgba color for the dividers, which can
28
+ // stack up with the background of a button toggle. This can cause the border
29
+ // of a selected toggle to look different from an deselected one. We use a solid
30
+ // color to ensure that the border always stays the same.
31
+ $divider-color: if(meta.type-of($theme-divider-color) == color,
32
+ theming.private-rgba-to-hex($theme-divider-color, map.get($background, card)),
33
+ $theme-divider-color
34
+ );
35
+
36
+ @return (
37
+ text-color: theming.get-color-from-palette($foreground, text),
38
+ background-color: theming.get-color-from-palette($background, card),
39
+ state-layer-color: theming.get-color-from-palette($background, focused-button, 1),
40
+ selected-state-background-color: theming.get-color-from-palette($background, selected-button),
41
+ selected-state-text-color: theming.get-color-from-palette($foreground, text),
42
+ disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-button),
43
+ disabled-state-background-color: theming.get-color-from-palette($background, card),
44
+ disabled-selected-state-text-color: theming.get-color-from-palette($foreground, text),
45
+ disabled-selected-state-background-color:
46
+ theming.get-color-from-palette($background, selected-disabled-button),
47
+ divider-color: $divider-color,
48
+ );
49
+ }
50
+
51
+ // Tokens that can be configured through Angular Material's typography theming API.
52
+ @function get-typography-tokens($config) {
53
+ @return (
54
+ // TODO(crisbeto): other components have tokens for all typography dimensions (font weight,
55
+ // letter spacing etc). The button toggle only has the font to match what it had in the
56
+ // old theming API and to reduce internal breakages. We should introduce more typography
57
+ // tokens at some point.
58
+ text-font: typography-utils.font-family($config),
59
+ );
60
+ }
61
+
62
+ // Tokens that can be configured through Angular Material's density theming API.
63
+ @function get-density-tokens($config) {
64
+ $density-scale: theming.clamp-density($config, -4);
65
+ $size-scale: (
66
+ 0: 48px,
67
+ -1: 44px,
68
+ -2: 40px,
69
+ -3: 36px,
70
+ -4: 24px,
71
+ );
72
+
73
+ @return (
74
+ height: map.get($size-scale, $density-scale)
75
+ );
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,79 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+ @use '../../../typography/typography-utils';
4
+ @use '../../../theming/theming';
5
+ @use '../../../style/sass-utils';
6
+
7
+ // The prefix used to generate the fully qualified name for tokens in this file.
8
+ $prefix: (mat, toolbar);
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
+ }
15
+
16
+ // Tokens that can be configured through Angular Material's color theming API.
17
+ @function get-color-tokens($config) {
18
+ $foreground: map.get($config, foreground);
19
+ $background: map.get($config, background);
20
+
21
+ @return private-get-color-palette-color-tokens(
22
+ $background-color: theming.get-color-from-palette($background, app-bar),
23
+ $text-color: theming.get-color-from-palette($foreground, text),
24
+ );
25
+ }
26
+
27
+ // Tokens that can be configured through Angular Material's typography theming API.
28
+ @function get-typography-tokens($config) {
29
+ @return (
30
+ title-text-font: typography-utils.font-family($config, title) or
31
+ typography-utils.font-family($config),
32
+ title-text-line-height: typography-utils.line-height($config, title),
33
+ title-text-size: typography-utils.font-size($config, title),
34
+ title-text-tracking: typography-utils.letter-spacing($config, title),
35
+ title-text-weight: typography-utils.font-weight($config, title),
36
+ );
37
+ }
38
+
39
+ // Tokens that can be configured through Angular Material's density theming API.
40
+ @function get-density-tokens($config) {
41
+ $density-scale: theming.clamp-density($config, -3);
42
+ $standard-scale: (
43
+ 0: 64px,
44
+ -1: 60px,
45
+ -2: 56px,
46
+ -3: 52px,
47
+ );
48
+
49
+ $mobile-scale: (
50
+ 0: 56px,
51
+ -1: 52px,
52
+ -2: 48px,
53
+ -3: 44px,
54
+ );
55
+
56
+ @return (
57
+ standard-height: map.get($standard-scale, $density-scale),
58
+ mobile-height: map.get($mobile-scale, $density-scale),
59
+ );
60
+ }
61
+
62
+ // Generates the tokens used to theme the toolbar based on a palette.
63
+ @function private-get-color-palette-color-tokens($background-color, $text-color) {
64
+ @return (
65
+ container-background-color: $background-color,
66
+ container-text-color: $text-color,
67
+ );
68
+ }
69
+
70
+ // Combines the tokens generated by the above functions into a single map with placeholder values.
71
+ // This is used to create token slots.
72
+ @function get-token-slots() {
73
+ @return sass-utils.deep-merge-all(
74
+ get-unthemable-tokens(),
75
+ get-color-tokens(token-utils.$placeholder-color-config),
76
+ get-typography-tokens(token-utils.$placeholder-typography-config),
77
+ get-density-tokens(token-utils.$placeholder-density-config)
78
+ );
79
+ }
@@ -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
+ }