@angular/material 17.0.0-rc.1 → 17.0.0-rc.2
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/button/_button-base.scss +37 -18
- package/button/_button-theme.scss +86 -142
- package/button/_fab-theme.scss +21 -49
- package/button/_icon-button-theme.scss +26 -25
- package/core/theming/_theming.scss +0 -14
- package/core/tokens/m2/mat/_fab.scss +87 -0
- package/core/tokens/m2/mat/_filled-button.scss +76 -0
- package/core/tokens/m2/mat/_icon-button.scss +73 -0
- package/core/tokens/m2/mat/_outlined-button.scss +73 -0
- package/core/tokens/m2/mat/_protected-button.scss +76 -0
- package/core/tokens/m2/mat/_text-button.scss +73 -0
- package/core/tokens/m2/mdc/_extended-fab.scss +3 -0
- package/core/tokens/m2/mdc/_fab.scss +17 -3
- package/core/tokens/m2/mdc/_filled-button.scss +24 -18
- package/core/tokens/m2/mdc/_icon-button.scss +0 -3
- package/core/tokens/m2/mdc/_outlined-button.scss +120 -0
- package/core/tokens/m2/mdc/_protected-button.scss +24 -19
- package/dialog/index.d.ts +2 -1
- package/esm2022/button/button.mjs +4 -4
- package/esm2022/button/fab.mjs +8 -8
- package/esm2022/button/icon-button.mjs +4 -4
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/dialog/dialog.mjs +1 -1
- package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
- package/fesm2022/button.mjs +16 -16
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/package.json +2 -2
- 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/schematics/migration.json +1 -1
- package/schematics/ng-add/fonts/material-fonts.js +1 -3
- package/schematics/ng-add/fonts/material-fonts.mjs +1 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-update/index_bundled.js +123 -30
- package/schematics/ng-update/index_bundled.js.map +4 -4
- package/button/_button-theme-private.scss +0 -67
- package/core/density/private/_compatibility.scss +0 -74
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
|
-
@use '@material/theme/theme-color' as mdc-theme-color;
|
|
4
|
-
|
|
5
|
-
@use '../core/mdc-helpers/mdc-helpers';
|
|
6
|
-
@use '../core/theming/inspection';
|
|
7
|
-
|
|
8
|
-
@mixin _ripple-color($color) {
|
|
9
|
-
--mat-mdc-button-persistent-ripple-color: #{$color};
|
|
10
|
-
--mat-mdc-button-ripple-color: #{rgba($color, 0.1)};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@mixin ripple-theme-styles($theme, $is-filled) {
|
|
14
|
-
$opacities: if(inspection.get-theme-type($theme) == dark,
|
|
15
|
-
mdc-ripple-theme.$light-ink-opacities, mdc-ripple-theme.$dark-ink-opacities);
|
|
16
|
-
|
|
17
|
-
// Ideally these styles would be structural, but MDC bases some of the opacities on the theme.
|
|
18
|
-
&:hover .mat-mdc-button-persistent-ripple::before {
|
|
19
|
-
opacity: map.get($opacities, hover);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&.cdk-program-focused,
|
|
23
|
-
&.cdk-keyboard-focused {
|
|
24
|
-
.mat-mdc-button-persistent-ripple::before {
|
|
25
|
-
opacity: map.get($opacities, focus);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:active .mat-mdc-button-persistent-ripple::before {
|
|
30
|
-
opacity: map.get($opacities, press);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@include _ripple-color(mdc-theme-color.prop-value(on-surface));
|
|
34
|
-
|
|
35
|
-
&.mat-primary {
|
|
36
|
-
@include _ripple-color(mdc-theme-color.prop-value(if($is-filled, on-primary, primary)));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.mat-accent {
|
|
40
|
-
@include _ripple-color(mdc-theme-color.prop-value(if($is-filled, on-secondary, secondary)));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.mat-warn {
|
|
44
|
-
@include _ripple-color(mdc-theme-color.prop-value(if($is-filled, on-error, error)));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Wraps the content style in a selector for the disabled state.
|
|
49
|
-
// MDC adds theme color by using :not(:disabled), so just using [disabled] once will not
|
|
50
|
-
// override this, neither will it apply to anchor tags. This needs to override the
|
|
51
|
-
// previously set theme color, so it must be ordered after the theme styles.
|
|
52
|
-
// TODO(andrewseguin): Discuss with the MDC team to see if we can avoid the :not(:disabled) by
|
|
53
|
-
// manually styling disabled buttons with a [disabled] selector.
|
|
54
|
-
@mixin apply-disabled-style() {
|
|
55
|
-
&[disabled][disabled] {
|
|
56
|
-
@content;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Hides the touch target on lower densities.
|
|
61
|
-
@mixin touch-target-density($scale) {
|
|
62
|
-
@include mdc-helpers.if-touch-targets-unsupported($scale) {
|
|
63
|
-
.mat-mdc-button-touch-target {
|
|
64
|
-
display: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:map';
|
|
3
|
-
@use 'sass:meta';
|
|
4
|
-
// Note that this file is called `private`, because the APIs in it aren't public yet.
|
|
5
|
-
// Once they're made available, the code should be moved out into an `index.scss`.
|
|
6
|
-
|
|
7
|
-
// Taken from mat-density with small modifications to not rely on the new Sass module
|
|
8
|
-
// system, and to support arbitrary properties in a density configuration.
|
|
9
|
-
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-density
|
|
10
|
-
|
|
11
|
-
$_density-interval: 4px !default;
|
|
12
|
-
$_minimum-scale: minimum !default;
|
|
13
|
-
$_maximum-scale: maximum !default;
|
|
14
|
-
$_supported-scales: (default, $_minimum-scale, $_maximum-scale) !default;
|
|
15
|
-
$_default-scale: 0 !default;
|
|
16
|
-
|
|
17
|
-
// Whether density should be generated at root. This will be temporarily set to `true`
|
|
18
|
-
// whenever density styles for legacy themes are generated.
|
|
19
|
-
$private-density-generate-at-root: false;
|
|
20
|
-
// Whether density styles should be generated. This will be temporarily set to `false` if
|
|
21
|
-
// duplicate density styles for a legacy theme would be generated. For legacy themes,
|
|
22
|
-
// we always generate the default density **only once** at root.
|
|
23
|
-
$private-density-generate-styles: true;
|
|
24
|
-
|
|
25
|
-
// Mixin that can be used to wrap density styles of given components. The mixin will
|
|
26
|
-
// move the density styles to root if the `$mat-private-density-generate-at-root` global variable
|
|
27
|
-
// is set. If `$mat-private-density-generate-styles` is set to `false`, generation of density
|
|
28
|
-
// styles wrapped in this mixin is skipped. This mixin exists to improve backwards compatibility
|
|
29
|
-
// of the new theming API where density styles are included as part of themes. Previously,
|
|
30
|
-
// density styles of components were part of their base styles. With the new API, they are
|
|
31
|
-
// part of the theming system. The `<..>-theme` mixins generate density by default unless
|
|
32
|
-
// the density configuration is explicitly specified as per new API. This means, that projects
|
|
33
|
-
// using `<..>-theme` mixins for separate themes (like `.dark-theme`) will cause duplicate
|
|
34
|
-
// density styles. This is breaking as it increases specificity of density styles. This mixin
|
|
35
|
-
// provides an API to control generation of density styles so that we can ensure they are only
|
|
36
|
-
// created *once* and at root.
|
|
37
|
-
@mixin private-density-legacy-compatibility() {
|
|
38
|
-
@if $private-density-generate-styles and $private-density-generate-at-root {
|
|
39
|
-
@at-root {
|
|
40
|
-
@content;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
@else if $private-density-generate-styles {
|
|
44
|
-
@content;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@function private-density-prop-value($density-config, $density-scale, $property-name) {
|
|
49
|
-
@if (meta.type-of($density-scale) == 'string' and
|
|
50
|
-
list.index($list: $_supported-scales, $value: $density-scale) == null) {
|
|
51
|
-
@error 'mat-density: Supported density scales #{$_supported-scales}, ' +
|
|
52
|
-
'but received #{$density-scale}.';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
$value: null;
|
|
56
|
-
$property-scale-map: map.get($density-config, $property-name);
|
|
57
|
-
|
|
58
|
-
@if map.has-key($property-scale-map, $density-scale) {
|
|
59
|
-
$value: map.get($property-scale-map, $density-scale);
|
|
60
|
-
}
|
|
61
|
-
@else {
|
|
62
|
-
$value: map.get($property-scale-map, default) + $density-scale * $_density-interval;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
$min-value: map.get($property-scale-map, $_minimum-scale);
|
|
66
|
-
$max-value: map.get($property-scale-map, $_maximum-scale);
|
|
67
|
-
|
|
68
|
-
@if ($value < $min-value or $value > $max-value) {
|
|
69
|
-
@error 'mat-density: #{$property-name} must be between #{$min-value} and ' +
|
|
70
|
-
'#{$max-value} (inclusive), but received #{$value}.';
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@return $value;
|
|
74
|
-
}
|