@angular/material 18.0.0-next.6 → 18.0.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 (97) hide show
  1. package/_index.scss +1 -1
  2. package/core/tokens/_m3-tokens.scss +8 -878
  3. package/core/tokens/_token-utils.scss +151 -0
  4. package/core/tokens/m2/mat/_switch.scss +1 -0
  5. package/core/tokens/m3/_index.scss +161 -0
  6. package/core/tokens/m3/mat/_app.scss +19 -0
  7. package/core/tokens/m3/mat/_autocomplete.scss +22 -0
  8. package/core/tokens/m3/mat/_badge.scss +77 -0
  9. package/core/tokens/m3/mat/_bottom-sheet.scss +24 -0
  10. package/core/tokens/m3/mat/_card.scss +24 -0
  11. package/core/tokens/m3/mat/_checkbox.scss +21 -0
  12. package/core/tokens/m3/mat/_chip.scss +46 -0
  13. package/core/tokens/m3/mat/_datepicker.scss +123 -0
  14. package/core/tokens/m3/mat/_dialog.scss +30 -0
  15. package/core/tokens/m3/mat/_divider.scss +19 -0
  16. package/core/tokens/m3/mat/_expansion.scss +41 -0
  17. package/core/tokens/m3/mat/_fab-small.scss +50 -0
  18. package/core/tokens/m3/mat/_fab.scss +50 -0
  19. package/core/tokens/m3/mat/_filled-button.scss +54 -0
  20. package/core/tokens/m3/mat/_form-field.scss +59 -0
  21. package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +42 -0
  22. package/core/tokens/m3/mat/_grid-list.scss +21 -0
  23. package/core/tokens/m3/mat/_icon-button.scss +27 -0
  24. package/core/tokens/m3/mat/_icon.scss +33 -0
  25. package/core/tokens/m3/mat/_list.scss +19 -0
  26. package/core/tokens/m3/mat/_menu.scss +42 -0
  27. package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +33 -0
  28. package/core/tokens/m3/mat/_optgroup.scss +22 -0
  29. package/core/tokens/m3/mat/_option.scss +55 -0
  30. package/core/tokens/m3/mat/_outlined-button.scss +54 -0
  31. package/core/tokens/m3/mat/_paginator.scss +27 -0
  32. package/core/tokens/m3/mat/_protected-button.scss +55 -0
  33. package/core/tokens/m3/mat/_radio.scss +34 -0
  34. package/core/tokens/m3/mat/_ripple.scss +19 -0
  35. package/core/tokens/m3/mat/_select.scss +46 -0
  36. package/core/tokens/m3/mat/_sidenav.scss +28 -0
  37. package/core/tokens/m3/mat/_slider.scss +56 -0
  38. package/core/tokens/m3/mat/_snack-bar.scss +18 -0
  39. package/core/tokens/m3/mat/_sort.scss +18 -0
  40. package/core/tokens/m3/mat/_standard-button-toggle.scss +57 -0
  41. package/core/tokens/m3/mat/_stepper.scss +79 -0
  42. package/core/tokens/m3/mat/_switch.scss +45 -0
  43. package/core/tokens/m3/mat/_tab-header.scss +51 -0
  44. package/core/tokens/m3/mat/_table.scss +28 -0
  45. package/core/tokens/m3/mat/_text-button.scss +55 -0
  46. package/core/tokens/m3/mat/_toolbar.scss +23 -0
  47. package/core/tokens/m3/mat/_tree.scss +22 -0
  48. package/core/tokens/m3/mdc/_checkbox.scss +110 -0
  49. package/core/tokens/m3/mdc/_chip.scss +91 -0
  50. package/core/tokens/m3/mdc/_circular-progress.scss +29 -0
  51. package/core/tokens/m3/mdc/_dialog.scss +39 -0
  52. package/core/tokens/m3/mdc/_elevated-card.scss +15 -0
  53. package/core/tokens/m3/mdc/_extended-fab.scss +21 -0
  54. package/core/tokens/m3/mdc/_fab-small.scss +21 -0
  55. package/core/tokens/m3/mdc/_fab.scss +21 -0
  56. package/core/tokens/m3/mdc/_filled-button.scss +86 -0
  57. package/core/tokens/m3/mdc/_filled-text-field.scss +92 -0
  58. package/core/tokens/m3/mdc/_form-field.scss +25 -0
  59. package/core/tokens/m3/mdc/_icon-button.scss +39 -0
  60. package/core/tokens/m3/mdc/_linear-progress.scss +32 -0
  61. package/core/tokens/m3/mdc/_list.scss +37 -0
  62. package/core/tokens/m3/mdc/_outlined-button.scss +83 -0
  63. package/core/tokens/m3/mdc/_outlined-card.scss +15 -0
  64. package/core/tokens/m3/mdc/_outlined-text-field.scss +85 -0
  65. package/core/tokens/m3/mdc/_plain-tooltip.scss +15 -0
  66. package/core/tokens/m3/mdc/_protected-button.scss +84 -0
  67. package/core/tokens/m3/mdc/_radio.scss +46 -0
  68. package/core/tokens/m3/mdc/_slider.scss +61 -0
  69. package/core/tokens/m3/mdc/_snack-bar.scss +15 -0
  70. package/core/tokens/m3/mdc/_switch.scss +70 -0
  71. package/core/tokens/m3/mdc/_tab-indicator.scss +33 -0
  72. package/core/tokens/m3/mdc/_tab.scss +15 -0
  73. package/core/tokens/m3/mdc/_text-button.scss +79 -0
  74. package/dialog/index.d.ts +4 -3
  75. package/esm2022/core/version.mjs +1 -1
  76. package/esm2022/dialog/dialog-content-directives.mjs +5 -2
  77. package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
  78. package/fesm2022/core.mjs +1 -1
  79. package/fesm2022/core.mjs.map +1 -1
  80. package/fesm2022/dialog.mjs +4 -1
  81. package/fesm2022/dialog.mjs.map +1 -1
  82. package/fesm2022/slide-toggle.mjs +2 -2
  83. package/fesm2022/slide-toggle.mjs.map +1 -1
  84. package/package.json +2 -2
  85. package/prebuilt-themes/azure-blue.css +1 -1
  86. package/prebuilt-themes/cyan-orange.css +1 -1
  87. package/prebuilt-themes/deeppurple-amber.css +1 -1
  88. package/prebuilt-themes/indigo-pink.css +1 -1
  89. package/prebuilt-themes/magenta-violet.css +1 -1
  90. package/prebuilt-themes/pink-bluegrey.css +1 -1
  91. package/prebuilt-themes/purple-green.css +1 -1
  92. package/prebuilt-themes/rose-red.css +1 -1
  93. package/schematics/ng-add/index.js +1 -1
  94. package/schematics/ng-add/index.mjs +1 -1
  95. package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
  96. package/schematics/ng-update/index_bundled.js +29 -29
  97. package/core/tokens/_custom-tokens.scss +0 -1918
@@ -0,0 +1,92 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use 'sass:list';
4
+ @use '../../token-utils';
5
+
6
+ // The prefix used to generate the fully qualified name for tokens in this file.
7
+ $prefix: (mdc, filled-text-field);
8
+
9
+ /// Generates the tokens for MDC filled-text-field
10
+ /// @param {Map} $systems The MDC system tokens
11
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
12
+ /// @param {Map} $token-slots Possible token slots
13
+ /// @return {Map} A set of tokens for the MDC filled-text-field
14
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
15
+ $mdc-tokens: token-utils.get-mdc-tokens('filled-text-field', $systems, $exclude-hardcoded);
16
+ $variant-tokens: (
17
+ primary: (), // Default, no overrides needed
18
+ secondary: (
19
+ caret-color: map.get($systems, md-sys-color, secondary),
20
+ focus-active-indicator-color: map.get($systems, md-sys-color, secondary),
21
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
22
+ ),
23
+ tertiary: (
24
+ caret-color: map.get($systems, md-sys-color, tertiary),
25
+ focus-active-indicator-color: map.get($systems, md-sys-color, tertiary),
26
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
27
+ ),
28
+ error: (
29
+ caret-color: map.get($systems, md-sys-color, error),
30
+ focus-active-indicator-color: map.get($systems, md-sys-color, error),
31
+ focus-label-text-color: map.get($systems, md-sys-color, error),
32
+ ),
33
+ );
34
+
35
+ @return token-utils.namespace-tokens($prefix, (
36
+ _fix-tokens($mdc-tokens),
37
+ token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
38
+ ), $token-slots);
39
+ }
40
+
41
+
42
+ /// Fixes inconsistent values in the filled text field tokens so that they can produce valid
43
+ /// styles.
44
+ /// @param {Map} $initial-tokens Map of filled text field tokens currently being generated.
45
+ /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
46
+ @function _fix-tokens($initial-tokens) {
47
+ // Need to get the hardcoded values, because they include opacities that are used for the disabled
48
+ // state.
49
+ $hardcoded-tokens: token-utils.get-mdc-tokens('filled-text-field', (), false);
50
+
51
+ $tokens: token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
52
+ (
53
+ color: disabled-active-indicator-color,
54
+ opacity: disabled-active-indicator-opacity
55
+ ),
56
+ (
57
+ color: disabled-container-color,
58
+ opacity: disabled-container-opacity
59
+ ),
60
+ (
61
+ color: disabled-input-text-color,
62
+ opacity: disabled-input-text-opacity
63
+ ),
64
+ (
65
+ color: disabled-label-text-color,
66
+ opacity: disabled-label-text-opacity
67
+ ),
68
+ (
69
+ color: disabled-leading-icon-color,
70
+ opacity: disabled-leading-icon-opacity
71
+ ),
72
+ (
73
+ color: disabled-supporting-text-color,
74
+ opacity: disabled-supporting-text-opacity
75
+ ),
76
+ (
77
+ color: disabled-trailing-icon-color,
78
+ opacity: disabled-trailing-icon-opacity
79
+ )
80
+ ));
81
+
82
+ $container-shape: map.get($tokens, container-shape);
83
+
84
+ // The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
85
+ // of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
86
+ // token slot in M2.
87
+ @if meta.type-of($container-shape) == 'list' {
88
+ $tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
89
+ }
90
+
91
+ @return $tokens;
92
+ }
@@ -0,0 +1,25 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mdc, form-field);
6
+
7
+ /// Generates the tokens for MDC form-field
8
+ /// @param {Map} $systems The MDC system tokens
9
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
10
+ /// @param {Map} $token-slots Possible token slots
11
+ /// @return {Map} A set of tokens for the MDC form-field
12
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
13
+ $tokens: (
14
+ // TODO: MDC currently doesn't provide tokens for the form field so we need to
15
+ // define them ourselves. Clean this up once b/246297033 is resolved.
16
+ label-text-color: map.get($systems, md-sys-color, on-surface),
17
+ label-text-font: map.get($systems, md-sys-typescale, body-medium-font),
18
+ label-text-line-height: map.get($systems, md-sys-typescale, body-medium-line-height),
19
+ label-text-size: map.get($systems, md-sys-typescale, body-medium-size),
20
+ label-text-tracking: map.get($systems, md-sys-typescale, body-medium-tracking),
21
+ label-text-weight: map.get($systems, md-sys-typescale, body-medium-weight),
22
+ );
23
+
24
+ @return token-utils.namespace-tokens($prefix, $tokens, $token-slots);
25
+ }
@@ -0,0 +1,39 @@
1
+ @use '../../token-utils';
2
+
3
+ // The prefix used to generate the fully qualified name for tokens in this file.
4
+ $prefix: (mdc, icon-button);
5
+
6
+ /// Generates the tokens for MDC icon-button
7
+ /// @param {Map} $systems The MDC system tokens
8
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
9
+ /// @param {Map} $token-slots Possible token slots
10
+ /// @return {Map} A set of tokens for the MDC icon-button
11
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
12
+ $mdc-tokens: token-utils.get-mdc-tokens('icon-button', $systems, $exclude-hardcoded);
13
+
14
+ @return token-utils.namespace-tokens($prefix, _fix-tokens($mdc-tokens), $token-slots);
15
+ }
16
+
17
+ /// Fixes inconsistent values in the icon button tokens so that they can produce valid styles.
18
+ /// @param {Map} $initial-tokens Map of icon button tokens currently being generated.
19
+ /// @param {Map} $all-tokens Map of all icon button tokens, including hardcoded values.
20
+ /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
21
+ @function _fix-tokens($tokens) {
22
+ // Need to get the hardcoded values, because they include opacities that are used for the disabled
23
+ // state.
24
+ $hardcoded-tokens: token-utils.get-mdc-tokens('icon-button', (), false);
25
+
26
+ $rename-keys: (
27
+ unselected-icon-color: icon-color,
28
+ );
29
+
30
+ $remapped-tokens: token-utils.rename-map-keys($tokens, $rename-keys);
31
+ $remapped-hardcoded-tokens: token-utils.rename-map-keys($hardcoded-tokens, $rename-keys);
32
+
33
+ @return token-utils.combine-color-tokens($remapped-tokens, $remapped-hardcoded-tokens, (
34
+ (
35
+ color: disabled-icon-color,
36
+ opacity: disabled-icon-opacity,
37
+ ),
38
+ ));
39
+ }
@@ -0,0 +1,32 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mdc, linear-progress);
6
+
7
+ /// Generates the tokens for MDC linear-progress
8
+ /// @param {Map} $systems The MDC system tokens
9
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
10
+ /// @param {Map} $token-slots Possible token slots
11
+ /// @return {Map} A set of tokens for the MDC linear-progress
12
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
13
+ $mdc-tokens:
14
+ token-utils.get-mdc-tokens('linear-progress-indicator', $systems, $exclude-hardcoded);
15
+ $variant-tokens: (
16
+ primary: (), // Default, no overrides needed
17
+ secondary: (
18
+ active-indicator-color: map.get($systems, md-sys-color, secondary),
19
+ track-color: map.get($systems, md-sys-color, secondary-container),
20
+ ),
21
+ tertiary: (
22
+ active-indicator-color: map.get($systems, md-sys-color, tertiary),
23
+ track-color: map.get($systems, md-sys-color, tertiary-container),
24
+ ),
25
+ error: (
26
+ active-indicator-color: map.get($systems, md-sys-color, error),
27
+ track-color: map.get($systems, md-sys-color, error-container),
28
+ ),
29
+ );
30
+
31
+ @return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
32
+ }
@@ -0,0 +1,37 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mdc, list);
6
+
7
+ /// Generates the tokens for MDC list
8
+ /// @param {Map} $systems The MDC system tokens
9
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
10
+ /// @param {Map} $token-slots Possible token slots
11
+ /// @return {Map} A set of tokens for the MDC list
12
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
13
+ $mdc-tokens: token-utils.get-mdc-tokens('list', $systems, $exclude-hardcoded);
14
+
15
+ @return token-utils.namespace-tokens($prefix, _fix-tokens($mdc-tokens), $token-slots);
16
+ }
17
+
18
+ /// Fixes values in the list tokens that are inconsistent with its usage.
19
+ /// @param {Map} $initial-tokens Map of list tokens currently being generated.
20
+ /// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
21
+ @function _fix-tokens($tokens) {
22
+ // This does not match the spec, which defines this to be `md.sys.color.surface`.
23
+ // However, this interferes with the use case of placing a list on other components. For example,
24
+ // the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
25
+ // list to just display the colors for its background.
26
+ @if map.get($tokens, list-item-container-color) != null {
27
+ $tokens: map.set($tokens, list-item-container-color, transparent);
28
+ }
29
+
30
+ // Match spec, which has list-item-leading-icon-size of 24px.
31
+ // Current version of tokens (0_161) has 18px.
32
+ @if map.get($tokens, list-item-leading-icon-size) != null {
33
+ $tokens: map.set($tokens, list-item-leading-icon-size, 24px);
34
+ }
35
+
36
+ @return $tokens;
37
+ }
@@ -0,0 +1,83 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '../../token-utils';
4
+
5
+ // The prefix used to generate the fully qualified name for tokens in this file.
6
+ $prefix: (mdc, outlined-button);
7
+
8
+ /// Generates the tokens for MDC outlined-button
9
+ /// @param {Map} $systems The MDC system tokens
10
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
+ /// @param {Map} $token-slots Possible token slots
12
+ /// @return {Map} A set of tokens for the MDC outlined-button
13
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
+ $mdc-tokens: token-utils.get-mdc-tokens('outlined-button', $systems, $exclude-hardcoded);
15
+ $variant-tokens: (
16
+ primary: (), // Default, no overrides needed.
17
+ secondary: (
18
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
19
+ focus-outline-color: map.get($systems, md-sys-color, secondary),
20
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
21
+ hover-label-text-color: map.get($systems, md-sys-color, secondary),
22
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
23
+ label-text-color: map.get($systems, md-sys-color, secondary),
24
+ pressed-label-text-color: map.get($systems, md-sys-color, secondary),
25
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
26
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
27
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
28
+ with-icon-icon-color: map.get($systems, md-sys-color, secondary),
29
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
30
+ ),
31
+ tertiary: (
32
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
33
+ focus-outline-color: map.get($systems, md-sys-color, tertiary),
34
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
35
+ hover-label-text-color: map.get($systems, md-sys-color, tertiary),
36
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
37
+ label-text-color: map.get($systems, md-sys-color, tertiary),
38
+ pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
39
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
40
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
41
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
42
+ with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
43
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
44
+ ),
45
+ error: (
46
+ focus-label-text-color: map.get($systems, md-sys-color, error),
47
+ focus-outline-color: map.get($systems, md-sys-color, error),
48
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
49
+ hover-label-text-color: map.get($systems, md-sys-color, error),
50
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
51
+ label-text-color: map.get($systems, md-sys-color, error),
52
+ pressed-label-text-color: map.get($systems, md-sys-color, error),
53
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
54
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
55
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
56
+ with-icon-icon-color: map.get($systems, md-sys-color, error),
57
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
58
+ )
59
+ );
60
+
61
+ @return token-utils.namespace-tokens($prefix, (
62
+ _fix-tokens($mdc-tokens),
63
+ token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
64
+ ), $token-slots);
65
+ }
66
+
67
+ /// Fixes inconsistent values in the outlined button tokens so that they can produce valid styles.
68
+ /// @param {Map} $initial-tokens Map of outlined button tokens currently being generated.
69
+ /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
70
+ @function _fix-tokens($initial-tokens) {
71
+ $hardcoded-tokens: token-utils.get-mdc-tokens('outlined-button', (), false);
72
+
73
+ @return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
74
+ (
75
+ color: disabled-label-text-color,
76
+ opacity: disabled-label-text-opacity,
77
+ ),
78
+ (
79
+ color: disabled-outline-color,
80
+ opacity: disabled-outline-opacity,
81
+ )
82
+ ));
83
+ }
@@ -0,0 +1,15 @@
1
+ @use '../../token-utils';
2
+
3
+ // The prefix used to generate the fully qualified name for tokens in this file.
4
+ $prefix: (mdc, outlined-card);
5
+
6
+ /// Generates the tokens for MDC outlined-card
7
+ /// @param {Map} $systems The MDC system tokens
8
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
9
+ /// @param {Map} $token-slots Possible token slots
10
+ /// @return {Map} A set of tokens for the MDC outlined-card
11
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
12
+ $mdc-tokens: token-utils.get-mdc-tokens('outlined-card', $systems, $exclude-hardcoded);
13
+
14
+ @return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
15
+ }
@@ -0,0 +1,85 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '../../token-utils';
4
+
5
+ // The prefix used to generate the fully qualified name for tokens in this file.
6
+ $prefix: (mdc, outlined-text-field);
7
+
8
+ /// Generates the tokens for MDC outlined-text-field
9
+ /// @param {Map} $systems The MDC system tokens
10
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
+ /// @param {Map} $token-slots Possible token slots
12
+ /// @return {Map} A set of tokens for the MDC outlined-text-field
13
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
+ $mdc-tokens: token-utils.get-mdc-tokens('outlined-text-field', $systems, $exclude-hardcoded);
15
+ $variant-tokens: (
16
+ primary: (), // Default, no overrides needed
17
+ secondary: (
18
+ caret-color: map.get($systems, md-sys-color, secondary),
19
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
20
+ focus-outline-color: map.get($systems, md-sys-color, secondary),
21
+ ),
22
+ tertiary: (
23
+ caret-color: map.get($systems, md-sys-color, tertiary),
24
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
25
+ focus-outline-color: map.get($systems, md-sys-color, tertiary),
26
+ ),
27
+ error: (
28
+ caret-color: map.get($systems, md-sys-color, error),
29
+ focus-label-text-color: map.get($systems, md-sys-color, error),
30
+ focus-outline-color: map.get($systems, md-sys-color, error),
31
+ ),
32
+ );
33
+
34
+ @return token-utils.namespace-tokens($prefix, (
35
+ _fix-tokens($mdc-tokens),
36
+ token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
37
+ ), $token-slots);
38
+ }
39
+
40
+ /// Fixes inconsistent values in the outlined text field tokens so that they can produce valid
41
+ /// styles.
42
+ /// @param {Map} $initial-tokens Map of outlined text field tokens currently being generated.
43
+ /// @param {Map} $all-tokens Map of all outlined text field tokens, including hardcoded values.
44
+ /// This is necessary in order to do opacity lookups.
45
+ /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
46
+ @function _fix-tokens($initial-tokens) {
47
+ // Need to get the hardcoded values, because they include opacities that are used for the disabled
48
+ // state.
49
+ $hardcoded-tokens: token-utils.get-mdc-tokens('outlined-text-field', (), false);
50
+
51
+ @return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
52
+ (
53
+ color: disabled-outline-color,
54
+ opacity: disabled-outline-opacity
55
+ ),
56
+ (
57
+ color: disabled-active-indicator-color,
58
+ opacity: disabled-active-indicator-opacity
59
+ ),
60
+ (
61
+ color: disabled-container-color,
62
+ opacity: disabled-container-opacity
63
+ ),
64
+ (
65
+ color: disabled-input-text-color,
66
+ opacity: disabled-input-text-opacity
67
+ ),
68
+ (
69
+ color: disabled-label-text-color,
70
+ opacity: disabled-label-text-opacity
71
+ ),
72
+ (
73
+ color: disabled-leading-icon-color,
74
+ opacity: disabled-leading-icon-opacity
75
+ ),
76
+ (
77
+ color: disabled-supporting-text-color,
78
+ opacity: disabled-supporting-text-opacity
79
+ ),
80
+ (
81
+ color: disabled-trailing-icon-color,
82
+ opacity: disabled-trailing-icon-opacity
83
+ )
84
+ ));
85
+ }
@@ -0,0 +1,15 @@
1
+ @use '../../token-utils';
2
+
3
+ // The prefix used to generate the fully qualified name for tokens in this file.
4
+ $prefix: (mdc, plain-tooltip);
5
+
6
+ /// Generates the tokens for MDC plain-tooltip
7
+ /// @param {Map} $systems The MDC system tokens
8
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
9
+ /// @param {Map} $token-slots Possible token slots
10
+ /// @return {Map} A set of tokens for the MDC plain-tooltip
11
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
12
+ $mdc-tokens: token-utils.get-mdc-tokens('plain-tooltip', $systems, $exclude-hardcoded);
13
+
14
+ @return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
15
+ }
@@ -0,0 +1,84 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+ @use '../../token-utils';
4
+
5
+ // The prefix used to generate the fully qualified name for tokens in this file.
6
+ $prefix: (mdc, protected-button);
7
+
8
+ /// Generates the tokens for MDC protected-button
9
+ /// @param {Map} $systems The MDC system tokens
10
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
11
+ /// @param {Map} $token-slots Possible token slots
12
+ /// @return {Map} A set of tokens for the MDC protected-button
13
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
+ // Note: in M3 the "protected" button is called "elevated".
15
+ $mdc-tokens: token-utils.get-mdc-tokens('elevated-button', $systems, $exclude-hardcoded);
16
+ $variant-tokens: (
17
+ primary: (), // Default, no overrides needed.
18
+ secondary: (
19
+ focus-label-text-color: map.get($systems, md-sys-color, secondary),
20
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
21
+ hover-label-text-color: map.get($systems, md-sys-color, secondary),
22
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
23
+ label-text-color: map.get($systems, md-sys-color, secondary),
24
+ pressed-label-text-color: map.get($systems, md-sys-color, secondary),
25
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
26
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
27
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
28
+ with-icon-icon-color: map.get($systems, md-sys-color, secondary),
29
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
30
+ ),
31
+ tertiary: (
32
+ focus-label-text-color: map.get($systems, md-sys-color, tertiary),
33
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
34
+ hover-label-text-color: map.get($systems, md-sys-color, tertiary),
35
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
36
+ label-text-color: map.get($systems, md-sys-color, tertiary),
37
+ pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
38
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
39
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
40
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
41
+ with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
42
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
43
+ ),
44
+ error: (
45
+ focus-label-text-color: map.get($systems, md-sys-color, error),
46
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
47
+ hover-label-text-color: map.get($systems, md-sys-color, error),
48
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
49
+ label-text-color: map.get($systems, md-sys-color, error),
50
+ pressed-label-text-color: map.get($systems, md-sys-color, error),
51
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
52
+ with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
53
+ with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
54
+ with-icon-icon-color: map.get($systems, md-sys-color, error),
55
+ with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
56
+ )
57
+ );
58
+
59
+ @return token-utils.namespace-tokens($prefix, (
60
+ _fix-tokens($mdc-tokens),
61
+ token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens)),
62
+ ), $token-slots);
63
+ }
64
+
65
+
66
+ /// Fixes inconsistent values in the protected button tokens so that they can produce valid styles.
67
+ /// @param {Map} $initial-tokens Map of protected button tokens currently being generated.
68
+ /// @return {Map} The given tokens, with the invalid values replaced with valid ones.
69
+ @function _fix-tokens($initial-tokens) {
70
+ // Need to get the hardcoded values, because they include opacities that are used for the disabled
71
+ // state.
72
+ $hardcoded-tokens: token-utils.get-mdc-tokens('elevated-button', (), false);
73
+
74
+ @return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
75
+ (
76
+ color: disabled-label-text-color,
77
+ opacity: disabled-label-text-opacity,
78
+ ),
79
+ (
80
+ color: disabled-container-color,
81
+ opacity: disabled-container-opacity,
82
+ )
83
+ ));
84
+ }
@@ -0,0 +1,46 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mdc, radio);
6
+
7
+ /// Generates the tokens for MDC radio
8
+ /// @param {Map} $systems The MDC system tokens
9
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
10
+ /// @param {Map} $token-slots Possible token slots
11
+ /// @return {Map} A set of tokens for the MDC radio
12
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
13
+ $mdc-tokens: token-utils.get-mdc-tokens('radio-button', $systems, $exclude-hardcoded);
14
+ $variant-tokens: (
15
+ primary: (), // Default, no overrides needed
16
+ secondary: (
17
+ selected-focus-icon-color: map.get($systems, md-sys-color, secondary),
18
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
19
+ selected-hover-icon-color: map.get($systems, md-sys-color, secondary),
20
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
21
+ selected-icon-color: map.get($systems, md-sys-color, secondary),
22
+ selected-pressed-icon-color: map.get($systems, md-sys-color, secondary),
23
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
24
+ ),
25
+ tertiary: (
26
+ selected-focus-icon-color: map.get($systems, md-sys-color, tertiary),
27
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
28
+ selected-hover-icon-color: map.get($systems, md-sys-color, tertiary),
29
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
30
+ selected-icon-color: map.get($systems, md-sys-color, tertiary),
31
+ selected-pressed-icon-color: map.get($systems, md-sys-color, tertiary),
32
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
33
+ ),
34
+ error: (
35
+ selected-focus-icon-color: map.get($systems, md-sys-color, error),
36
+ selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
37
+ selected-hover-icon-color: map.get($systems, md-sys-color, error),
38
+ selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
39
+ selected-icon-color: map.get($systems, md-sys-color, error),
40
+ selected-pressed-icon-color: map.get($systems, md-sys-color, error),
41
+ unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
42
+ ),
43
+ );
44
+
45
+ @return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
46
+ }
@@ -0,0 +1,61 @@
1
+ @use 'sass:map';
2
+ @use '../../token-utils';
3
+
4
+ // The prefix used to generate the fully qualified name for tokens in this file.
5
+ $prefix: (mdc, slider);
6
+
7
+ /// Generates the tokens for MDC slider
8
+ /// @param {Map} $systems The MDC system tokens
9
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
10
+ /// @param {Map} $token-slots Possible token slots
11
+ /// @return {Map} A set of tokens for the MDC slider
12
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
13
+ $mdc-tokens: token-utils.get-mdc-tokens('slider', $systems, $exclude-hardcoded);
14
+ $variant-tokens: (
15
+ primary: (), // Default, no overrides needed
16
+ secondary: (
17
+ active-track-color: map.get($systems, md-sys-color, secondary),
18
+ focus-handle-color: map.get($systems, md-sys-color, secondary),
19
+ focus-state-layer-color: map.get($systems, md-sys-color, secondary),
20
+ handle-color: map.get($systems, md-sys-color, secondary),
21
+ hover-handle-color: map.get($systems, md-sys-color, secondary),
22
+ hover-state-layer-color: map.get($systems, md-sys-color, secondary),
23
+ label-container-color: map.get($systems, md-sys-color, secondary),
24
+ label-label-text-color: map.get($systems, md-sys-color, on-secondary),
25
+ pressed-handle-color: map.get($systems, md-sys-color, secondary),
26
+ pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
27
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-secondary),
28
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-secondary),
29
+ ),
30
+ tertiary: (
31
+ active-track-color: map.get($systems, md-sys-color, tertiary),
32
+ focus-handle-color: map.get($systems, md-sys-color, tertiary),
33
+ focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
34
+ handle-color: map.get($systems, md-sys-color, tertiary),
35
+ hover-handle-color: map.get($systems, md-sys-color, tertiary),
36
+ hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
37
+ label-container-color: map.get($systems, md-sys-color, tertiary),
38
+ label-label-text-color: map.get($systems, md-sys-color, on-tertiary),
39
+ pressed-handle-color: map.get($systems, md-sys-color, tertiary),
40
+ pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
41
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-tertiary),
42
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-tertiary),
43
+ ),
44
+ error: (
45
+ active-track-color: map.get($systems, md-sys-color, error),
46
+ focus-handle-color: map.get($systems, md-sys-color, error),
47
+ focus-state-layer-color: map.get($systems, md-sys-color, error),
48
+ handle-color: map.get($systems, md-sys-color, error),
49
+ hover-handle-color: map.get($systems, md-sys-color, error),
50
+ hover-state-layer-color: map.get($systems, md-sys-color, error),
51
+ label-container-color: map.get($systems, md-sys-color, error),
52
+ label-label-text-color: map.get($systems, md-sys-color, on-error),
53
+ pressed-handle-color: map.get($systems, md-sys-color, error),
54
+ pressed-state-layer-color: map.get($systems, md-sys-color, error),
55
+ with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-error),
56
+ with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-error),
57
+ ),
58
+ );
59
+
60
+ @return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
61
+ }
@@ -0,0 +1,15 @@
1
+ @use '../../token-utils';
2
+
3
+ // The prefix used to generate the fully qualified name for tokens in this file.
4
+ $prefix: (mdc, snackbar);
5
+
6
+ /// Generates the tokens for MDC snackbar
7
+ /// @param {Map} $systems The MDC system tokens
8
+ /// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
9
+ /// @param {Map} $token-slots Possible token slots
10
+ /// @return {Map} A set of tokens for the MDC snackbar
11
+ @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
12
+ $mdc-tokens: token-utils.get-mdc-tokens('snackbar', $systems, $exclude-hardcoded);
13
+
14
+ @return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
15
+ }