@angular/material 20.1.0-next.1 → 20.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.
- package/_index.scss +1 -2
- package/autocomplete/_autocomplete-theme.scss +28 -37
- package/autocomplete/_m2-autocomplete.scss +10 -22
- package/badge/_badge-theme.scss +35 -44
- package/badge/_m2-badge.scss +46 -59
- package/bottom-sheet/_bottom-sheet-theme.scss +28 -40
- package/bottom-sheet/_m2-bottom-sheet.scss +16 -33
- package/button/_button-theme.scss +37 -55
- package/button/_fab-theme.scss +42 -56
- package/button/_icon-button-theme.scss +33 -49
- package/button/_m2-button.scss +135 -158
- package/button/_m2-fab.scss +60 -69
- package/button/_m2-icon-button.scss +30 -50
- package/button/_m3-button.scss +1 -2
- package/button/_m3-fab.scss +1 -2
- package/button/_m3-icon-button.scss +1 -2
- package/button/testing/index.d.ts +1 -0
- package/button-toggle/_button-toggle-theme.scss +29 -44
- package/button-toggle/_m2-button-toggle.scss +58 -81
- package/button-toggle/_m3-button-toggle.scss +1 -2
- package/card/_card-theme.scss +28 -36
- package/card/_m2-card.scss +30 -45
- package/checkbox/_checkbox-theme.scss +37 -50
- package/checkbox/_m2-checkbox.scss +30 -40
- package/checkbox/_m3-checkbox.scss +1 -2
- package/chips/_chips-theme.scss +27 -30
- package/chips/_m2-chip.scss +40 -53
- package/chips/_m3-chip.scss +1 -2
- package/core/_core-theme.scss +48 -67
- package/core/_m2-app.scss +11 -23
- package/core/focus-indicators/_private.scss +2 -5
- package/core/m2/_theming.scss +36 -41
- package/core/option/_m2-optgroup.scss +13 -25
- package/core/option/_m2-option.scss +16 -22
- package/core/option/_optgroup-theme.scss +28 -30
- package/core/option/_option-theme.scss +35 -34
- package/core/ripple/_m2-ripple.scss +8 -20
- package/core/ripple/_ripple-theme.scss +28 -33
- package/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss +14 -21
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +55 -45
- package/core/theming/_all-theme.scss +38 -42
- package/core/theming/_definition.scss +22 -13
- package/core/theming/_inspection.scss +0 -12
- package/core/theming/_m2-inspection.scss +0 -33
- package/core/theming/_theming.scss +4 -172
- package/core/tokens/_m2-utils.scss +16 -68
- package/core/tokens/_m3-utils.scss +2 -14
- package/core/tokens/_token-utils.scss +7 -27
- package/core/tokens/m2/_index.scss +6 -0
- package/core/tokens/m2/_md-sys-color.scss +123 -0
- package/core/tokens/m2/_md-sys-elevation.scss +16 -0
- package/core/tokens/m2/_md-sys-motion.scss +36 -0
- package/core/tokens/m2/_md-sys-shape.scss +22 -0
- package/core/tokens/m2/_md-sys-state.scss +15 -0
- package/core/tokens/m2/_md-sys-typescale.scss +68 -0
- package/core/tokens/m3/_md-sys-color.scss +2 -2
- package/core/tokens/m3/_md-sys-typescale.scss +1 -1
- package/core/tokens/m3/_theme.scss +14 -26
- package/datepicker/_datepicker-theme.scss +38 -40
- package/datepicker/_m2-datepicker.scss +26 -40
- package/dialog/_dialog-theme.scss +28 -34
- package/dialog/_m2-dialog.scss +34 -48
- package/divider/_divider-theme.scss +28 -30
- package/divider/_m2-divider.scss +10 -21
- package/expansion/_expansion-theme.scss +28 -39
- package/expansion/_m2-expansion.scss +52 -67
- package/expansion/_m3-expansion.scss +3 -2
- package/fesm2022/autocomplete.mjs +1 -1
- package/fesm2022/button/testing.mjs +7 -4
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +1 -1
- package/fesm2022/expansion.mjs +2 -2
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/{form-field-C9DZXojn.mjs → form-field-CFbrnFED.mjs} +3 -3
- package/fesm2022/{form-field-C9DZXojn.mjs.map → form-field-CFbrnFED.mjs.map} +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/input.mjs +3 -27
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +97 -13
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +343 -122
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/{module-BDiw_nWS.mjs → module-B0CLRw5e.mjs} +3 -3
- package/fesm2022/{module-BDiw_nWS.mjs.map → module-B0CLRw5e.mjs.map} +1 -1
- package/fesm2022/{module-DzZHEh7B.mjs → module-B62K-792.mjs} +2 -2
- package/fesm2022/{module-DzZHEh7B.mjs.map → module-B62K-792.mjs.map} +1 -1
- package/fesm2022/paginator.mjs +3 -3
- package/fesm2022/select.mjs +3 -3
- package/fesm2022/sidenav.mjs +2 -4
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/timepicker.mjs +1 -1
- package/form-field/_form-field-theme.scss +35 -51
- package/form-field/_m2-form-field.scss +125 -146
- package/form-field/_m3-form-field.scss +1 -2
- package/grid-list/_grid-list-theme.scss +28 -28
- package/grid-list/_m2-grid-list.scss +16 -29
- package/icon/_icon-theme.scss +40 -41
- package/icon/_m2-icon.scss +7 -21
- package/input/_input-theme.scss +1 -4
- package/input/index.d.ts +0 -11
- package/list/_list-theme.scss +57 -53
- package/list/_m2-list.scss +84 -108
- package/list/_m3-list.scss +1 -2
- package/menu/_m2-menu.scss +33 -46
- package/menu/_menu-theme.scss +28 -33
- package/menu/index.d.ts +145 -61
- package/menu/testing/index.d.ts +50 -2
- package/package.json +2 -2
- package/paginator/_m2-paginator.scss +38 -58
- package/paginator/_m3-paginator.scss +1 -2
- package/paginator/_paginator-theme.scss +28 -33
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-bar/_m2-progress-bar.scss +11 -24
- package/progress-bar/_progress-bar-theme.scss +35 -43
- package/progress-spinner/_m2-progress-spinner.scss +9 -20
- package/progress-spinner/_progress-spinner-theme.scss +42 -43
- package/radio/_m2-radio.scss +30 -40
- package/radio/_m3-radio.scss +1 -2
- package/radio/_radio-theme.scss +33 -46
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-generate/theme-color/schema.json +1 -1
- package/select/_m2-select.scss +23 -30
- package/select/_m3-select.scss +1 -2
- package/select/_select-theme.scss +38 -51
- package/sidenav/_m2-sidenav.scss +26 -36
- package/sidenav/_sidenav-theme.scss +28 -30
- package/slide-toggle/_m2-slide-toggle.scss +111 -143
- package/slide-toggle/_m3-slide-toggle.scss +1 -0
- package/slide-toggle/_slide-toggle-theme.scss +42 -80
- package/slider/_m2-slider.scss +34 -55
- package/slider/_slider-theme.scss +38 -45
- package/snack-bar/_m2-snack-bar.scss +16 -36
- package/snack-bar/_snack-bar-theme.scss +28 -31
- package/sort/_m2-sort.scss +7 -18
- package/sort/_sort-theme.scss +28 -33
- package/stepper/_m2-stepper.scss +39 -57
- package/stepper/_m3-stepper.scss +1 -2
- package/stepper/_stepper-theme.scss +41 -49
- package/table/_m2-table.scss +54 -72
- package/table/_m3-table.scss +1 -2
- package/table/_table-theme.scss +28 -36
- package/tabs/_m2-tabs.scss +31 -46
- package/tabs/_m3-tabs.scss +1 -2
- package/tabs/_tabs-theme.scss +41 -49
- package/timepicker/_m2-timepicker.scss +10 -22
- package/timepicker/_timepicker-theme.scss +28 -46
- package/toolbar/_m2-toolbar.scss +26 -46
- package/toolbar/_m3-toolbar.scss +1 -2
- package/toolbar/_toolbar-theme.scss +55 -46
- package/tooltip/_m2-tooltip.scss +16 -34
- package/tooltip/_tooltip-theme.scss +28 -37
- package/tree/_m2-tree.scss +21 -38
- package/tree/_m3-tree.scss +1 -2
- package/tree/_tree-theme.scss +28 -38
- package/core/tokens/_format-tokens.scss +0 -5
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/style/sass-utils';
|
|
3
2
|
@use './m2-dialog';
|
|
4
3
|
@use './m3-dialog';
|
|
5
4
|
@use '../core/tokens/token-utils';
|
|
6
|
-
@use '../core/theming/theming';
|
|
7
5
|
@use '../core/theming/inspection';
|
|
8
6
|
@use '../core/typography/typography';
|
|
9
7
|
|
|
10
8
|
@mixin base($theme) {
|
|
9
|
+
$tokens: map.get(m2-dialog.get-tokens($theme), base);
|
|
11
10
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
|
-
|
|
13
|
-
} @else {
|
|
14
|
-
// Add default values for tokens not related to color, typography, or density.
|
|
15
|
-
@include sass-utils.current-selector-or-root() {
|
|
16
|
-
@include token-utils.create-token-values-mixed(m2-dialog.get-unthemable-tokens());
|
|
17
|
-
}
|
|
11
|
+
$tokens: map.get(m3-dialog.get-tokens($theme), base);
|
|
18
12
|
}
|
|
13
|
+
|
|
14
|
+
@include token-utils.values($tokens);
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
@mixin color($theme) {
|
|
18
|
+
$tokens: map.get(m2-dialog.get-tokens($theme), color);
|
|
22
19
|
@if inspection.get-theme-version($theme) == 1 {
|
|
23
|
-
|
|
24
|
-
} @else {
|
|
25
|
-
@include sass-utils.current-selector-or-root() {
|
|
26
|
-
@include token-utils.create-token-values-mixed(m2-dialog.get-color-tokens($theme));
|
|
27
|
-
}
|
|
20
|
+
$tokens: map.get(m3-dialog.get-tokens($theme), color);
|
|
28
21
|
}
|
|
22
|
+
|
|
23
|
+
@include token-utils.values($tokens);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
@mixin typography($theme) {
|
|
27
|
+
$tokens: map.get(m2-dialog.get-tokens($theme), typography);
|
|
32
28
|
@if inspection.get-theme-version($theme) == 1 {
|
|
33
|
-
|
|
34
|
-
} @else {
|
|
35
|
-
@include sass-utils.current-selector-or-root() {
|
|
36
|
-
@include token-utils.create-token-values-mixed(m2-dialog.get-typography-tokens($theme));
|
|
37
|
-
}
|
|
29
|
+
$tokens: map.get(m3-dialog.get-tokens($theme), typography);
|
|
38
30
|
}
|
|
31
|
+
|
|
32
|
+
@include token-utils.values($tokens);
|
|
39
33
|
}
|
|
40
34
|
|
|
41
35
|
@mixin density($theme) {
|
|
36
|
+
$tokens: map.get(m2-dialog.get-tokens($theme), density);
|
|
42
37
|
@if inspection.get-theme-version($theme) == 1 {
|
|
43
|
-
|
|
44
|
-
} @else {
|
|
38
|
+
$tokens: map.get(m3-dialog.get-tokens($theme), density);
|
|
45
39
|
}
|
|
40
|
+
|
|
41
|
+
@include token-utils.values($tokens);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -60,23 +56,21 @@
|
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
@mixin theme($theme) {
|
|
63
|
-
@
|
|
64
|
-
@
|
|
65
|
-
|
|
59
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
60
|
+
@include base($theme);
|
|
61
|
+
@include color($theme);
|
|
62
|
+
@include density($theme);
|
|
63
|
+
@include typography($theme);
|
|
64
|
+
} @else {
|
|
65
|
+
@include base($theme);
|
|
66
|
+
@if inspection.theme-has($theme, color) {
|
|
66
67
|
@include color($theme);
|
|
68
|
+
}
|
|
69
|
+
@if inspection.theme-has($theme, density) {
|
|
67
70
|
@include density($theme);
|
|
71
|
+
}
|
|
72
|
+
@if inspection.theme-has($theme, typography) {
|
|
68
73
|
@include typography($theme);
|
|
69
|
-
} @else {
|
|
70
|
-
@include base($theme);
|
|
71
|
-
@if inspection.theme-has($theme, color) {
|
|
72
|
-
@include color($theme);
|
|
73
|
-
}
|
|
74
|
-
@if inspection.theme-has($theme, density) {
|
|
75
|
-
@include density($theme);
|
|
76
|
-
}
|
|
77
|
-
@if inspection.theme-has($theme, typography) {
|
|
78
|
-
@include typography($theme);
|
|
79
|
-
}
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
76
|
}
|
package/dialog/_m2-dialog.scss
CHANGED
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
@use '../core/style/elevation';
|
|
2
|
-
@use '../core/theming/inspection';
|
|
3
2
|
@use '../core/tokens/m2-utils';
|
|
4
3
|
@use 'sass:map';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
// but may be in a future version of the theming API.
|
|
8
|
-
@function get-unthemable-tokens() {
|
|
9
|
-
@return (
|
|
10
|
-
dialog-container-shape: 4px,
|
|
11
|
-
dialog-container-elevation-shadow: elevation.get-box-shadow(24),
|
|
12
|
-
dialog-container-max-width: 80vw,
|
|
13
|
-
dialog-container-small-max-width: 80vw,
|
|
14
|
-
dialog-container-min-width: 0,
|
|
15
|
-
dialog-actions-alignment: start,
|
|
16
|
-
dialog-actions-padding: 8px,
|
|
17
|
-
dialog-content-padding: 20px 24px,
|
|
18
|
-
dialog-with-actions-content-padding: 20px 24px,
|
|
19
|
-
|
|
20
|
-
// Note: the CSS class is `title` while the M2 tokens call it `subhead`.
|
|
21
|
-
// M3 calls it `headline` which is what we're aligning with.
|
|
22
|
-
dialog-headline-padding: 0 24px 9px,
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
27
|
-
@function get-color-tokens($theme) {
|
|
5
|
+
@function get-tokens($theme) {
|
|
28
6
|
$system: m2-utils.get-system($theme);
|
|
29
|
-
@return (
|
|
30
|
-
dialog-container-color: map.get($system, surface),
|
|
31
|
-
dialog-subhead-color: map.get($system, on-surface),
|
|
32
|
-
dialog-supporting-text-color: map.get($system, on-surface-variant),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
7
|
|
|
36
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
37
|
-
@function get-typography-tokens($theme) {
|
|
38
8
|
@return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
dialog-supporting-text-tracking:
|
|
50
|
-
inspection.get-theme-typography($theme, body-1, letter-spacing),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
9
|
+
base: (
|
|
10
|
+
dialog-container-shape: 4px,
|
|
11
|
+
dialog-container-elevation-shadow: elevation.get-box-shadow(24),
|
|
12
|
+
dialog-container-max-width: 80vw,
|
|
13
|
+
dialog-container-small-max-width: 80vw,
|
|
14
|
+
dialog-container-min-width: 0,
|
|
15
|
+
dialog-actions-alignment: start,
|
|
16
|
+
dialog-actions-padding: 8px,
|
|
17
|
+
dialog-content-padding: 20px 24px,
|
|
18
|
+
dialog-with-actions-content-padding: 20px 24px,
|
|
53
19
|
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
20
|
+
// Note: the CSS class is `title` while the M2 tokens call it `subhead`.
|
|
21
|
+
// M3 calls it `headline` which is what we're aligning with.
|
|
22
|
+
dialog-headline-padding: 0 24px 9px,
|
|
23
|
+
),
|
|
24
|
+
color: (
|
|
25
|
+
dialog-container-color: map.get($system, surface),
|
|
26
|
+
dialog-subhead-color: map.get($system, on-surface),
|
|
27
|
+
dialog-supporting-text-color: map.get($system, on-surface-variant),
|
|
28
|
+
),
|
|
29
|
+
typography: (
|
|
30
|
+
dialog-subhead-font: map.get($system, title-small-font),
|
|
31
|
+
dialog-subhead-line-height: map.get($system, title-small-line-height),
|
|
32
|
+
dialog-subhead-size: map.get($system, title-small-size),
|
|
33
|
+
dialog-subhead-weight: map.get($system, title-small-weight),
|
|
34
|
+
dialog-subhead-tracking: map.get($system, title-small-tracking),
|
|
35
|
+
dialog-supporting-text-font: map.get($system, body-large-font),
|
|
36
|
+
dialog-supporting-text-line-height: map.get($system, body-large-line-height),
|
|
37
|
+
dialog-supporting-text-size: map.get($system, body-large-size),
|
|
38
|
+
dialog-supporting-text-weight: map.get($system, body-large-weight),
|
|
39
|
+
dialog-supporting-text-tracking: map.get($system, body-large-tracking),
|
|
40
|
+
),
|
|
41
|
+
density: (),
|
|
42
|
+
);
|
|
57
43
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/style/sass-utils';
|
|
3
|
-
@use '../core/theming/theming';
|
|
4
2
|
@use '../core/theming/inspection';
|
|
5
3
|
@use '../core/tokens/token-utils';
|
|
6
4
|
@use './m2-divider';
|
|
7
5
|
@use './m3-divider';
|
|
8
6
|
|
|
9
7
|
@mixin base($theme) {
|
|
8
|
+
$tokens: map.get(m2-divider.get-tokens($theme), base);
|
|
10
9
|
@if inspection.get-theme-version($theme) == 1 {
|
|
11
|
-
|
|
12
|
-
} @else {
|
|
13
|
-
@include sass-utils.current-selector-or-root() {
|
|
14
|
-
@include token-utils.create-token-values-mixed(m2-divider.get-unthemable-tokens());
|
|
15
|
-
}
|
|
10
|
+
$tokens: map.get(m3-divider.get-tokens($theme), base);
|
|
16
11
|
}
|
|
12
|
+
|
|
13
|
+
@include token-utils.values($tokens);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
@mixin color($theme) {
|
|
17
|
+
$tokens: map.get(m2-divider.get-tokens($theme), color);
|
|
20
18
|
@if inspection.get-theme-version($theme) == 1 {
|
|
21
|
-
|
|
22
|
-
} @else {
|
|
23
|
-
@include sass-utils.current-selector-or-root() {
|
|
24
|
-
@include token-utils.create-token-values-mixed(m2-divider.get-color-tokens($theme));
|
|
25
|
-
}
|
|
19
|
+
$tokens: map.get(m3-divider.get-tokens($theme), color);
|
|
26
20
|
}
|
|
21
|
+
|
|
22
|
+
@include token-utils.values($tokens);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
@mixin typography($theme) {
|
|
26
|
+
$tokens: map.get(m2-divider.get-tokens($theme), typography);
|
|
30
27
|
@if inspection.get-theme-version($theme) == 1 {
|
|
31
|
-
|
|
32
|
-
} @else {
|
|
28
|
+
$tokens: map.get(m3-divider.get-tokens($theme), typography);
|
|
33
29
|
}
|
|
30
|
+
|
|
31
|
+
@include token-utils.values($tokens);
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
@mixin density($theme) {
|
|
35
|
+
$tokens: map.get(m2-divider.get-tokens($theme), density);
|
|
37
36
|
@if inspection.get-theme-version($theme) == 1 {
|
|
38
|
-
|
|
39
|
-
} @else {
|
|
37
|
+
$tokens: map.get(m3-divider.get-tokens($theme), density);
|
|
40
38
|
}
|
|
39
|
+
|
|
40
|
+
@include token-utils.values($tokens);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -55,23 +55,21 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@mixin theme($theme) {
|
|
58
|
-
@
|
|
59
|
-
@
|
|
60
|
-
|
|
58
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
59
|
+
@include base($theme);
|
|
60
|
+
@include color($theme);
|
|
61
|
+
@include density($theme);
|
|
62
|
+
@include typography($theme);
|
|
63
|
+
} @else {
|
|
64
|
+
@include base($theme);
|
|
65
|
+
@if inspection.theme-has($theme, color) {
|
|
61
66
|
@include color($theme);
|
|
67
|
+
}
|
|
68
|
+
@if inspection.theme-has($theme, density) {
|
|
62
69
|
@include density($theme);
|
|
70
|
+
}
|
|
71
|
+
@if inspection.theme-has($theme, typography) {
|
|
63
72
|
@include typography($theme);
|
|
64
|
-
} @else {
|
|
65
|
-
@include base($theme);
|
|
66
|
-
@if inspection.theme-has($theme, color) {
|
|
67
|
-
@include color($theme);
|
|
68
|
-
}
|
|
69
|
-
@if inspection.theme-has($theme, density) {
|
|
70
|
-
@include density($theme);
|
|
71
|
-
}
|
|
72
|
-
@if inspection.theme-has($theme, typography) {
|
|
73
|
-
@include typography($theme);
|
|
74
|
-
}
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
}
|
package/divider/_m2-divider.scss
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
@use '../core/tokens/m2-utils';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
// but may be in a future version of the theming API.
|
|
6
|
-
@function get-unthemable-tokens() {
|
|
7
|
-
@return (
|
|
8
|
-
divider-width: 1px
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
13
|
-
@function get-color-tokens($theme) {
|
|
4
|
+
@function get-tokens($theme) {
|
|
14
5
|
$system: m2-utils.get-system($theme);
|
|
6
|
+
|
|
15
7
|
@return (
|
|
16
|
-
|
|
8
|
+
base: (
|
|
9
|
+
divider-width: 1px
|
|
10
|
+
),
|
|
11
|
+
color: (
|
|
12
|
+
divider-color: map.get($system, outline)
|
|
13
|
+
),
|
|
14
|
+
typography: (),
|
|
15
|
+
density: (),
|
|
17
16
|
);
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
21
|
-
@function get-typography-tokens($theme) {
|
|
22
|
-
@return ();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Tokens that can be configured through Angular Material's density theming API.
|
|
26
|
-
@function get-density-tokens($theme) {
|
|
27
|
-
@return ();
|
|
28
|
-
}
|
|
@@ -1,53 +1,44 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../core/theming/theming';
|
|
3
2
|
@use '../core/theming/inspection';
|
|
4
3
|
@use '../core/typography/typography';
|
|
5
|
-
@use '../core/style/sass-utils';
|
|
6
4
|
@use '../core/tokens/token-utils';
|
|
7
5
|
@use './m2-expansion';
|
|
8
6
|
@use './m3-expansion';
|
|
9
7
|
|
|
10
8
|
@mixin base($theme) {
|
|
9
|
+
$tokens: map.get(m2-expansion.get-tokens($theme), base);
|
|
11
10
|
@if inspection.get-theme-version($theme) == 1 {
|
|
12
|
-
|
|
13
|
-
} @else {
|
|
14
|
-
@include sass-utils.current-selector-or-root() {
|
|
15
|
-
@include token-utils.create-token-values-mixed(m2-expansion.get-unthemable-tokens());
|
|
16
|
-
}
|
|
11
|
+
$tokens: map.get(m3-expansion.get-tokens($theme), base);
|
|
17
12
|
}
|
|
13
|
+
|
|
14
|
+
@include token-utils.values($tokens);
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
@mixin color($theme) {
|
|
18
|
+
$tokens: map.get(m2-expansion.get-tokens($theme), color);
|
|
21
19
|
@if inspection.get-theme-version($theme) == 1 {
|
|
22
|
-
|
|
23
|
-
} @else {
|
|
24
|
-
@include sass-utils.current-selector-or-root() {
|
|
25
|
-
@include token-utils.create-token-values-mixed(m2-expansion.get-color-tokens($theme));
|
|
26
|
-
}
|
|
20
|
+
$tokens: map.get(m3-expansion.get-tokens($theme), color);
|
|
27
21
|
}
|
|
22
|
+
|
|
23
|
+
@include token-utils.values($tokens);
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
@mixin typography($theme) {
|
|
27
|
+
$tokens: map.get(m2-expansion.get-tokens($theme), typography);
|
|
31
28
|
@if inspection.get-theme-version($theme) == 1 {
|
|
32
|
-
|
|
33
|
-
} @else {
|
|
34
|
-
// TODO(mmalerba): Stop calling this and resolve resulting screen diffs.
|
|
35
|
-
$theme: inspection.private-get-typography-back-compat-theme($theme);
|
|
36
|
-
|
|
37
|
-
@include sass-utils.current-selector-or-root() {
|
|
38
|
-
@include token-utils.create-token-values-mixed(m2-expansion.get-typography-tokens($theme));
|
|
39
|
-
}
|
|
29
|
+
$tokens: map.get(m3-expansion.get-tokens($theme), typography);
|
|
40
30
|
}
|
|
31
|
+
|
|
32
|
+
@include token-utils.values($tokens);
|
|
41
33
|
}
|
|
42
34
|
|
|
43
35
|
@mixin density($theme) {
|
|
36
|
+
$tokens: map.get(m2-expansion.get-tokens($theme), density);
|
|
44
37
|
@if inspection.get-theme-version($theme) == 1 {
|
|
45
|
-
|
|
46
|
-
} @else {
|
|
47
|
-
@include sass-utils.current-selector-or-root() {
|
|
48
|
-
@include token-utils.create-token-values-mixed(m2-expansion.get-density-tokens($theme));
|
|
49
|
-
}
|
|
38
|
+
$tokens: map.get(m3-expansion.get-tokens($theme), density);
|
|
50
39
|
}
|
|
40
|
+
|
|
41
|
+
@include token-utils.values($tokens);
|
|
51
42
|
}
|
|
52
43
|
|
|
53
44
|
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
@@ -65,23 +56,21 @@
|
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
@mixin theme($theme) {
|
|
68
|
-
@
|
|
69
|
-
@
|
|
70
|
-
|
|
59
|
+
@if inspection.get-theme-version($theme) == 1 {
|
|
60
|
+
@include base($theme);
|
|
61
|
+
@include color($theme);
|
|
62
|
+
@include density($theme);
|
|
63
|
+
@include typography($theme);
|
|
64
|
+
} @else {
|
|
65
|
+
@include base($theme);
|
|
66
|
+
@if inspection.theme-has($theme, color) {
|
|
71
67
|
@include color($theme);
|
|
68
|
+
}
|
|
69
|
+
@if inspection.theme-has($theme, density) {
|
|
72
70
|
@include density($theme);
|
|
71
|
+
}
|
|
72
|
+
@if inspection.theme-has($theme, typography) {
|
|
73
73
|
@include typography($theme);
|
|
74
|
-
} @else {
|
|
75
|
-
@include base($theme);
|
|
76
|
-
@if inspection.theme-has($theme, color) {
|
|
77
|
-
@include color($theme);
|
|
78
|
-
}
|
|
79
|
-
@if inspection.theme-has($theme, density) {
|
|
80
|
-
@include density($theme);
|
|
81
|
-
}
|
|
82
|
-
@if inspection.theme-has($theme, typography) {
|
|
83
|
-
@include typography($theme);
|
|
84
|
-
}
|
|
85
74
|
}
|
|
86
75
|
}
|
|
87
76
|
}
|
|
@@ -1,79 +1,64 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../core/theming/theming';
|
|
3
|
-
@use '../core/theming/inspection';
|
|
4
3
|
@use '../core/tokens/m2-utils';
|
|
5
4
|
@use '../core/tokens/m3-utils';
|
|
5
|
+
@use '../core/style/elevation';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
// but may be in a future version of the theming API.
|
|
9
|
-
@function get-unthemable-tokens() {
|
|
10
|
-
@return (
|
|
11
|
-
expansion-container-shape: 4px,
|
|
12
|
-
expansion-legacy-header-indicator-display: inline-block,
|
|
13
|
-
expansion-header-indicator-display: none,
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
-
@function get-color-tokens($theme) {
|
|
7
|
+
@function get-tokens($theme) {
|
|
19
8
|
$system: m2-utils.get-system($theme);
|
|
20
|
-
|
|
21
|
-
expansion-container-background-color: map.get($system, surface),
|
|
22
|
-
expansion-container-text-color: map.get($system, on-surface),
|
|
23
|
-
expansion-actions-divider-color: map.get($system, outline),
|
|
24
|
-
expansion-header-hover-state-layer-color: m3-utils.color-with-opacity(
|
|
25
|
-
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
|
|
26
|
-
expansion-header-focus-state-layer-color: m3-utils.color-with-opacity(
|
|
27
|
-
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
|
|
28
|
-
expansion-header-disabled-state-text-color:
|
|
29
|
-
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
30
|
-
expansion-header-text-color: map.get($system, on-surface),
|
|
31
|
-
expansion-header-description-color: map.get($system, on-surface-variant),
|
|
32
|
-
expansion-header-indicator-color: map.get($system, on-surface-variant),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
9
|
+
$density-scale: theming.clamp-density(map.get($system, density-scale), -3);
|
|
35
10
|
|
|
36
|
-
// Tokens that can be configured through Angular Material's typography theming API.
|
|
37
|
-
@function get-typography-tokens($theme) {
|
|
38
11
|
@return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
base: (
|
|
13
|
+
expansion-container-shape: 4px,
|
|
14
|
+
expansion-container-elevation-shadow: elevation.get-box-shadow(2),
|
|
15
|
+
expansion-legacy-header-indicator-display: inline-block,
|
|
16
|
+
expansion-header-indicator-display: none,
|
|
17
|
+
),
|
|
18
|
+
color: (
|
|
19
|
+
expansion-container-background-color: map.get($system, surface),
|
|
20
|
+
expansion-container-text-color: map.get($system, on-surface),
|
|
21
|
+
expansion-actions-divider-color: map.get($system, outline),
|
|
22
|
+
expansion-header-hover-state-layer-color: m3-utils.color-with-opacity(
|
|
23
|
+
map.get($system, on-surface), map.get($system, hover-state-layer-opacity)),
|
|
24
|
+
expansion-header-focus-state-layer-color: m3-utils.color-with-opacity(
|
|
25
|
+
map.get($system, on-surface), map.get($system, focus-state-layer-opacity)),
|
|
26
|
+
expansion-header-disabled-state-text-color:
|
|
27
|
+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
|
|
28
|
+
expansion-header-text-color: map.get($system, on-surface),
|
|
29
|
+
expansion-header-description-color: map.get($system, on-surface-variant),
|
|
30
|
+
expansion-header-indicator-color: map.get($system, on-surface-variant),
|
|
31
|
+
),
|
|
32
|
+
typography: (
|
|
33
|
+
expansion-header-text-font: map.get($system, label-medium-font),
|
|
34
|
+
expansion-header-text-size: map.get($system, label-medium-size),
|
|
35
|
+
expansion-header-text-weight: map.get($system, label-medium-weight),
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
// TODO(crisbeto): these two properties weren't set at all before the introduction of tokens,
|
|
38
|
+
// but it's inconsistent not to provide them since the container sets all of them. Eventually
|
|
39
|
+
// we should change the values to use come from `subtitle-2`.
|
|
40
|
+
expansion-header-text-line-height: inherit,
|
|
41
|
+
expansion-header-text-tracking: inherit,
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
0: 64px,
|
|
70
|
-
-1: 60px,
|
|
71
|
-
-2: 56px,
|
|
72
|
-
-3: 48px,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
@return (
|
|
76
|
-
expansion-header-collapsed-state-height: map.get($collapsed-scale, $scale),
|
|
77
|
-
expansion-header-expanded-state-height: map.get($expanded-scale, $scale),
|
|
43
|
+
expansion-container-text-font: map.get($system, body-medium-font),
|
|
44
|
+
expansion-container-text-line-height: map.get($system, body-medium-line-height),
|
|
45
|
+
expansion-container-text-size: map.get($system, body-medium-size),
|
|
46
|
+
expansion-container-text-tracking: map.get($system, body-medium-tracking),
|
|
47
|
+
expansion-container-text-weight: map.get($system, body-medium-weight),
|
|
48
|
+
),
|
|
49
|
+
density: (
|
|
50
|
+
expansion-header-collapsed-state-height: map.get((
|
|
51
|
+
0: 48px,
|
|
52
|
+
-1: 44px,
|
|
53
|
+
-2: 40px,
|
|
54
|
+
-3: 36px,
|
|
55
|
+
), $density-scale),
|
|
56
|
+
expansion-header-expanded-state-height: map.get((
|
|
57
|
+
0: 64px,
|
|
58
|
+
-1: 60px,
|
|
59
|
+
-2: 56px,
|
|
60
|
+
-3: 48px,
|
|
61
|
+
), $density-scale),
|
|
62
|
+
),
|
|
78
63
|
);
|
|
79
64
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@use 'sass:list';
|
|
3
3
|
@use '../core/tokens/m3-utils';
|
|
4
4
|
@use '../core/theming/theming';
|
|
5
|
-
@use '../core/theming/inspection';
|
|
6
5
|
@use '../core/tokens/m3';
|
|
6
|
+
@use '../core/style/elevation';
|
|
7
7
|
|
|
8
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
9
|
$prefix: (mat, expansion);
|
|
@@ -17,6 +17,7 @@ $prefix: (mat, expansion);
|
|
|
17
17
|
expansion-container-shape: 12px,
|
|
18
18
|
expansion-header-indicator-display: inline-block,
|
|
19
19
|
expansion-legacy-header-indicator-display: none,
|
|
20
|
+
expansion-container-elevation-shadow: elevation.get-box-shadow(2),
|
|
20
21
|
),
|
|
21
22
|
color: (
|
|
22
23
|
expansion-actions-divider-color: map.get($system, outline),
|
|
@@ -44,7 +45,7 @@ $prefix: (mat, expansion);
|
|
|
44
45
|
expansion-header-text-tracking: map.get($system, title-medium-tracking),
|
|
45
46
|
expansion-header-text-weight: map.get($system, title-medium-weight),
|
|
46
47
|
),
|
|
47
|
-
density: get-density-tokens(map.get($
|
|
48
|
+
density: get-density-tokens(map.get($system, density-scale)),
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -15,7 +15,7 @@ import { TemplatePortal } from '@angular/cdk/portal';
|
|
|
15
15
|
import { coerceArray } from '@angular/cdk/coercion';
|
|
16
16
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
17
|
import { filter, map, startWith, switchMap, tap, delay, take } from 'rxjs/operators';
|
|
18
|
-
import { h as MAT_FORM_FIELD } from './form-field-
|
|
18
|
+
import { h as MAT_FORM_FIELD } from './form-field-CFbrnFED.mjs';
|
|
19
19
|
import { M as MatOptionModule } from './index-DwiL-HGk.mjs';
|
|
20
20
|
import { M as MatCommonModule } from './common-module-cKSwHniA.mjs';
|
|
21
21
|
import './ripple-BYgV4oZC.mjs';
|
|
@@ -3,10 +3,13 @@ import { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk
|
|
|
3
3
|
|
|
4
4
|
/** Harness for interacting with a mat-button in tests. */
|
|
5
5
|
class MatButtonHarness extends ContentContainerComponentHarness {
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// Note: `.mat-mdc-button-base` should be enough for all buttons, however some apps are using
|
|
7
|
+
// the harness without actually having an applied button. Keep the attributes for backwards
|
|
8
|
+
// compatibility.
|
|
9
|
+
/** Selector for the harness. */
|
|
10
|
+
static hostSelector = `.mat-mdc-button-base, [matButton], [mat-button], [matIconButton],
|
|
11
|
+
[matFab], [matMiniFab], [mat-raised-button], [mat-flat-button], [mat-icon-button],
|
|
12
|
+
[mat-stroked-button], [mat-fab], [mat-mini-fab]`;
|
|
10
13
|
/**
|
|
11
14
|
* Gets a `HarnessPredicate` that can be used to search for a button with specific attributes.
|
|
12
15
|
* @param options Options for narrowing the search:
|