@ng-matero/extensions 18.1.0 → 18.1.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/checkbox-group/checkbox-group.d.ts +3 -3
- package/core/m2/_typography.scss +172 -0
- package/core/style/_elevation.scss +167 -0
- package/core/tokens/_m3-tokens.scss +10 -10
- package/core/tokens/_token-utils.scss +120 -30
- package/core/tokens/m2/mtx/_datetimepicker.scss +3 -3
- package/core/tokens/m2/mtx/_drawer.scss +2 -2
- package/core/tokens/m2/mtx/_select.scss +2 -4
- package/core/tokens/m3/definitions/_index.scss +8 -0
- package/core/tokens/m3/definitions/_md-ref-palette.scss +100 -0
- package/core/tokens/m3/definitions/_md-ref-typeface.scss +14 -0
- package/core/tokens/m3/definitions/_md-sys-color.scss +126 -0
- package/core/tokens/m3/definitions/_md-sys-elevation.scss +15 -0
- package/core/tokens/m3/definitions/_md-sys-motion.scss +46 -0
- package/core/tokens/m3/definitions/_md-sys-shape.scss +24 -0
- package/core/tokens/m3/definitions/_md-sys-state.scss +13 -0
- package/core/tokens/m3/definitions/_md-sys-typescale.scss +308 -0
- package/core/tokens/m3/mtx/_datetimepicker.scss +3 -3
- package/core/tokens/m3/mtx/_drawer.scss +2 -2
- package/core/tokens/m3/mtx/_select.scss +2 -2
- package/core/typography/_all-typography.scss +2 -2
- package/esm2022/alert/alert-module.mjs +4 -4
- package/esm2022/alert/alert.mjs +3 -3
- package/esm2022/button/button-loading.mjs +3 -3
- package/esm2022/button/button-module.mjs +4 -4
- package/esm2022/checkbox-group/checkbox-group-module.mjs +4 -4
- package/esm2022/checkbox-group/checkbox-group.mjs +3 -3
- package/esm2022/colorpicker/colorpicker-input.mjs +3 -3
- package/esm2022/colorpicker/colorpicker-module.mjs +4 -4
- package/esm2022/colorpicker/colorpicker-toggle.mjs +6 -6
- package/esm2022/colorpicker/colorpicker.mjs +6 -6
- package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
- package/esm2022/column-resize/column-resize-directives/column-resize.mjs +3 -3
- package/esm2022/column-resize/column-resize-module.mjs +4 -4
- package/esm2022/column-resize/column-resize-notifier.mjs +6 -6
- package/esm2022/column-resize/column-resize.mjs +3 -3
- package/esm2022/column-resize/column-size-store.mjs +3 -3
- package/esm2022/column-resize/event-dispatcher.mjs +3 -3
- package/esm2022/column-resize/overlay-handle.mjs +3 -3
- package/esm2022/column-resize/resizable.mjs +3 -3
- package/esm2022/column-resize/resize-strategy.mjs +9 -9
- package/esm2022/core/datetime/datetime.module.mjs +8 -8
- package/esm2022/core/datetime/native-datetime-adapter.mjs +3 -3
- package/esm2022/core/pipes/is-template-ref.pipe.mjs +3 -3
- package/esm2022/core/pipes/pipes.module.mjs +4 -4
- package/esm2022/core/pipes/to-observable.pipe.mjs +3 -3
- package/esm2022/datetimepicker/calendar-body.mjs +3 -3
- package/esm2022/datetimepicker/calendar.mjs +3 -3
- package/esm2022/datetimepicker/clock.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-actions.mjs +12 -12
- package/esm2022/datetimepicker/datetimepicker-input.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-module.mjs +4 -4
- package/esm2022/datetimepicker/datetimepicker-toggle.mjs +6 -6
- package/esm2022/datetimepicker/datetimepicker.mjs +6 -6
- package/esm2022/datetimepicker/month-view.mjs +3 -3
- package/esm2022/datetimepicker/multi-year-view.mjs +3 -3
- package/esm2022/datetimepicker/time.mjs +8 -9
- package/esm2022/datetimepicker/year-view.mjs +3 -3
- package/esm2022/dialog/dialog-container.mjs +3 -3
- package/esm2022/dialog/dialog-module.mjs +4 -4
- package/esm2022/dialog/dialog.mjs +3 -3
- package/esm2022/drawer/drawer-container.mjs +3 -3
- package/esm2022/drawer/drawer-module.mjs +4 -4
- package/esm2022/drawer/drawer.mjs +3 -3
- package/esm2022/grid/cell.mjs +3 -3
- package/esm2022/grid/column-menu.mjs +3 -3
- package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
- package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +3 -3
- package/esm2022/grid/column-resize/column-resize-module.mjs +8 -8
- package/esm2022/grid/column-resize/overlay-handle.mjs +3 -3
- package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +3 -3
- package/esm2022/grid/column-resize/resize-strategy.mjs +3 -3
- package/esm2022/grid/expansion-toggle.mjs +3 -3
- package/esm2022/grid/grid-module.mjs +4 -4
- package/esm2022/grid/grid-pipes.mjs +21 -21
- package/esm2022/grid/grid-utils.mjs +3 -3
- package/esm2022/grid/grid.mjs +3 -3
- package/esm2022/grid/selectable-cell.mjs +3 -3
- package/esm2022/loader/loader-module.mjs +4 -4
- package/esm2022/loader/loader.mjs +3 -3
- package/esm2022/photoviewer/photoviewer-module.mjs +4 -4
- package/esm2022/photoviewer/photoviewer.mjs +3 -3
- package/esm2022/popover/popover-content.mjs +6 -6
- package/esm2022/popover/popover-module.mjs +4 -4
- package/esm2022/popover/popover-target.mjs +3 -3
- package/esm2022/popover/popover-trigger.mjs +3 -3
- package/esm2022/popover/popover.mjs +3 -3
- package/esm2022/progress/progress-module.mjs +4 -4
- package/esm2022/progress/progress.mjs +3 -3
- package/esm2022/select/option.mjs +3 -3
- package/esm2022/select/select-module.mjs +4 -4
- package/esm2022/select/select.mjs +3 -3
- package/esm2022/select/templates.mjs +33 -33
- package/esm2022/split/split-module.mjs +4 -4
- package/esm2022/split/split-pane.mjs +3 -3
- package/esm2022/split/split.mjs +3 -3
- package/esm2022/tooltip/tooltip-module.mjs +4 -4
- package/esm2022/tooltip/tooltip.mjs +6 -6
- package/fesm2022/mtxAlert.mjs +7 -7
- package/fesm2022/mtxButton.mjs +7 -7
- package/fesm2022/mtxCheckboxGroup.mjs +7 -7
- package/fesm2022/mtxColorpicker.mjs +19 -19
- package/fesm2022/mtxColumnResize.mjs +40 -40
- package/fesm2022/mtxCore.mjs +21 -21
- package/fesm2022/mtxDatetimepicker.mjs +59 -60
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +10 -10
- package/fesm2022/mtxDrawer.mjs +10 -10
- package/fesm2022/mtxGrid.mjs +66 -66
- package/fesm2022/mtxLoader.mjs +7 -7
- package/fesm2022/mtxPhotoviewer.mjs +7 -7
- package/fesm2022/mtxPopover.mjs +19 -19
- package/fesm2022/mtxProgress.mjs +7 -7
- package/fesm2022/mtxSelect.mjs +43 -43
- package/fesm2022/mtxSplit.mjs +10 -10
- package/fesm2022/mtxTooltip.mjs +10 -10
- package/package.json +14 -14
- package/tooltip/_tooltip-theme.scss +19 -15
- package/core/typography/_typography.scss +0 -40
|
@@ -5,9 +5,9 @@ import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
|
|
|
5
5
|
import { MtxCheckboxGroupOption } from './interfaces';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class MtxCheckboxBase {
|
|
8
|
-
label?: any
|
|
9
|
-
value?: any
|
|
10
|
-
constructor(label?: any
|
|
8
|
+
label?: any;
|
|
9
|
+
value?: any;
|
|
10
|
+
constructor(label?: any, value?: any);
|
|
11
11
|
}
|
|
12
12
|
export declare class MtxCheckboxGroup implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
13
13
|
private _changeDetectorRef;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
|
|
6
|
+
$_default-font-family: string.unquote('Roboto, sans-serif');
|
|
7
|
+
|
|
8
|
+
@function _px-to-rem($px) {
|
|
9
|
+
@return math.div($px, 16px) * 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@function _get-letter-spacing($tracking, $font-size) {
|
|
13
|
+
@return math.div($tracking, $font-size * 16) * 1em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$_mdc-levels: (
|
|
17
|
+
headline1: (
|
|
18
|
+
font-family: $_default-font-family,
|
|
19
|
+
font-size: _px-to-rem(96px),
|
|
20
|
+
line-height: _px-to-rem(96px),
|
|
21
|
+
font-weight: 300,
|
|
22
|
+
letter-spacing: _get-letter-spacing(-1.5, 6),
|
|
23
|
+
text-decoration: inherit,
|
|
24
|
+
text-transform: inherit,
|
|
25
|
+
),
|
|
26
|
+
headline2: (
|
|
27
|
+
font-family: $_default-font-family,
|
|
28
|
+
font-size: _px-to-rem(60px),
|
|
29
|
+
line-height: _px-to-rem(60px),
|
|
30
|
+
font-weight: 300,
|
|
31
|
+
letter-spacing: _get-letter-spacing(-0.5, 3.75),
|
|
32
|
+
text-decoration: inherit,
|
|
33
|
+
text-transform: inherit,
|
|
34
|
+
),
|
|
35
|
+
headline3: (
|
|
36
|
+
font-family: $_default-font-family,
|
|
37
|
+
font-size: _px-to-rem(48px),
|
|
38
|
+
line-height: _px-to-rem(50px),
|
|
39
|
+
font-weight: 400,
|
|
40
|
+
letter-spacing: normal,
|
|
41
|
+
text-decoration: inherit,
|
|
42
|
+
text-transform: inherit,
|
|
43
|
+
),
|
|
44
|
+
headline4: (
|
|
45
|
+
font-family: $_default-font-family,
|
|
46
|
+
font-size: _px-to-rem(34px),
|
|
47
|
+
line-height: _px-to-rem(40px),
|
|
48
|
+
font-weight: 400,
|
|
49
|
+
letter-spacing: _get-letter-spacing(0.25, 2.125),
|
|
50
|
+
text-decoration: inherit,
|
|
51
|
+
text-transform: inherit,
|
|
52
|
+
),
|
|
53
|
+
headline5: (
|
|
54
|
+
font-family: $_default-font-family,
|
|
55
|
+
font-size: _px-to-rem(24px),
|
|
56
|
+
line-height: _px-to-rem(32px),
|
|
57
|
+
font-weight: 400,
|
|
58
|
+
letter-spacing: normal,
|
|
59
|
+
text-decoration: inherit,
|
|
60
|
+
text-transform: inherit,
|
|
61
|
+
),
|
|
62
|
+
headline6: (
|
|
63
|
+
font-family: $_default-font-family,
|
|
64
|
+
font-size: _px-to-rem(20px),
|
|
65
|
+
line-height: _px-to-rem(32px),
|
|
66
|
+
font-weight: 500,
|
|
67
|
+
letter-spacing: _get-letter-spacing(0.25, 1.25),
|
|
68
|
+
text-decoration: inherit,
|
|
69
|
+
text-transform: inherit,
|
|
70
|
+
),
|
|
71
|
+
subtitle1: (
|
|
72
|
+
font-family: $_default-font-family,
|
|
73
|
+
font-size: _px-to-rem(16px),
|
|
74
|
+
line-height: _px-to-rem(28px),
|
|
75
|
+
font-weight: 400,
|
|
76
|
+
letter-spacing: _get-letter-spacing(0.15, 1),
|
|
77
|
+
text-decoration: inherit,
|
|
78
|
+
text-transform: inherit,
|
|
79
|
+
),
|
|
80
|
+
subtitle2: (
|
|
81
|
+
font-family: $_default-font-family,
|
|
82
|
+
font-size: _px-to-rem(14px),
|
|
83
|
+
line-height: _px-to-rem(22px),
|
|
84
|
+
font-weight: 500,
|
|
85
|
+
letter-spacing: _get-letter-spacing(0.1, 0.875),
|
|
86
|
+
text-decoration: inherit,
|
|
87
|
+
text-transform: inherit,
|
|
88
|
+
),
|
|
89
|
+
body1: (
|
|
90
|
+
font-family: $_default-font-family,
|
|
91
|
+
font-size: _px-to-rem(16px),
|
|
92
|
+
line-height: _px-to-rem(24px),
|
|
93
|
+
font-weight: 400,
|
|
94
|
+
letter-spacing: _get-letter-spacing(0.5, 1),
|
|
95
|
+
text-decoration: inherit,
|
|
96
|
+
text-transform: inherit,
|
|
97
|
+
),
|
|
98
|
+
body2: (
|
|
99
|
+
font-family: $_default-font-family,
|
|
100
|
+
font-size: _px-to-rem(14px),
|
|
101
|
+
line-height: _px-to-rem(20px),
|
|
102
|
+
font-weight: 400,
|
|
103
|
+
letter-spacing: _get-letter-spacing(0.25, 0.875),
|
|
104
|
+
text-decoration: inherit,
|
|
105
|
+
text-transform: inherit,
|
|
106
|
+
),
|
|
107
|
+
caption: (
|
|
108
|
+
font-family: $_default-font-family,
|
|
109
|
+
font-size: _px-to-rem(12px),
|
|
110
|
+
line-height: _px-to-rem(20px),
|
|
111
|
+
font-weight: 400,
|
|
112
|
+
letter-spacing: _get-letter-spacing(0.4, 0.75),
|
|
113
|
+
text-decoration: inherit,
|
|
114
|
+
text-transform: inherit,
|
|
115
|
+
),
|
|
116
|
+
button: (
|
|
117
|
+
font-family: $_default-font-family,
|
|
118
|
+
font-size: _px-to-rem(14px),
|
|
119
|
+
line-height: _px-to-rem(36px),
|
|
120
|
+
font-weight: 500,
|
|
121
|
+
letter-spacing: _get-letter-spacing(1.25, 0.875),
|
|
122
|
+
text-decoration: none,
|
|
123
|
+
text-transform: uppercase,
|
|
124
|
+
),
|
|
125
|
+
overline: (
|
|
126
|
+
font-family: $_default-font-family,
|
|
127
|
+
font-size: _px-to-rem(12px),
|
|
128
|
+
line-height: _px-to-rem(32px),
|
|
129
|
+
font-weight: 500,
|
|
130
|
+
letter-spacing: _get-letter-spacing(2, 0.75),
|
|
131
|
+
text-decoration: none,
|
|
132
|
+
text-transform: uppercase,
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
/// Defines a typography level from the Material Design spec.
|
|
137
|
+
/// @param {String} $font-size The font-size for this level.
|
|
138
|
+
/// @param {String | Number} $line-height The line-height for this level.
|
|
139
|
+
/// @param {String | Number} $font-weight The font-weight for this level.
|
|
140
|
+
/// @param {String} $font-family The font-family for this level.
|
|
141
|
+
/// @param {String} $letter-spacing The letter-spacing for this level.
|
|
142
|
+
/// @returns {Map} A map representing the definition of this typographic level.
|
|
143
|
+
@function define-typography-level(
|
|
144
|
+
$font-size,
|
|
145
|
+
$line-height: $font-size,
|
|
146
|
+
$font-weight: 400,
|
|
147
|
+
$font-family: null,
|
|
148
|
+
$letter-spacing: normal) {
|
|
149
|
+
|
|
150
|
+
@return (
|
|
151
|
+
font-size: $font-size,
|
|
152
|
+
line-height: $line-height,
|
|
153
|
+
font-weight: $font-weight,
|
|
154
|
+
font-family: $font-family,
|
|
155
|
+
letter-spacing: $letter-spacing
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Converts an MDC typography level config to an Angular Material one.
|
|
160
|
+
@function typography-config-level-from-mdc($mdc-level, $font-family: null) {
|
|
161
|
+
$mdc-level-config: map.get($_mdc-levels, $mdc-level);
|
|
162
|
+
|
|
163
|
+
// Explicitly default the font family to null since we'll apply it globally
|
|
164
|
+
// through the `define-typgraphy-config`/`define-legacy-typography-config`.
|
|
165
|
+
@return define-typography-level(
|
|
166
|
+
$font-family: $font-family,
|
|
167
|
+
$font-size: map.get($mdc-level-config, font-size),
|
|
168
|
+
$line-height: map.get($mdc-level-config, line-height),
|
|
169
|
+
$font-weight: map.get($mdc-level-config, font-weight),
|
|
170
|
+
$letter-spacing: map.get($mdc-level-config, letter-spacing)
|
|
171
|
+
);
|
|
172
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
|
|
6
|
+
$_umbra-opacity: 0.2;
|
|
7
|
+
$_penumbra-opacity: 0.14;
|
|
8
|
+
$_ambient-opacity: 0.12;
|
|
9
|
+
|
|
10
|
+
$_umbra-map: (
|
|
11
|
+
0: '0px 0px 0px 0px',
|
|
12
|
+
1: '0px 2px 1px -1px',
|
|
13
|
+
2: '0px 3px 1px -2px',
|
|
14
|
+
3: '0px 3px 3px -2px',
|
|
15
|
+
4: '0px 2px 4px -1px',
|
|
16
|
+
5: '0px 3px 5px -1px',
|
|
17
|
+
6: '0px 3px 5px -1px',
|
|
18
|
+
7: '0px 4px 5px -2px',
|
|
19
|
+
8: '0px 5px 5px -3px',
|
|
20
|
+
9: '0px 5px 6px -3px',
|
|
21
|
+
10: '0px 6px 6px -3px',
|
|
22
|
+
11: '0px 6px 7px -4px',
|
|
23
|
+
12: '0px 7px 8px -4px',
|
|
24
|
+
13: '0px 7px 8px -4px',
|
|
25
|
+
14: '0px 7px 9px -4px',
|
|
26
|
+
15: '0px 8px 9px -5px',
|
|
27
|
+
16: '0px 8px 10px -5px',
|
|
28
|
+
17: '0px 8px 11px -5px',
|
|
29
|
+
18: '0px 9px 11px -5px',
|
|
30
|
+
19: '0px 9px 12px -6px',
|
|
31
|
+
20: '0px 10px 13px -6px',
|
|
32
|
+
21: '0px 10px 13px -6px',
|
|
33
|
+
22: '0px 10px 14px -6px',
|
|
34
|
+
23: '0px 11px 14px -7px',
|
|
35
|
+
24: '0px 11px 15px -7px',
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
$_penumbra-map: (
|
|
39
|
+
0: '0px 0px 0px 0px',
|
|
40
|
+
1: '0px 1px 1px 0px',
|
|
41
|
+
2: '0px 2px 2px 0px',
|
|
42
|
+
3: '0px 3px 4px 0px',
|
|
43
|
+
4: '0px 4px 5px 0px',
|
|
44
|
+
5: '0px 5px 8px 0px',
|
|
45
|
+
6: '0px 6px 10px 0px',
|
|
46
|
+
7: '0px 7px 10px 1px',
|
|
47
|
+
8: '0px 8px 10px 1px',
|
|
48
|
+
9: '0px 9px 12px 1px',
|
|
49
|
+
10: '0px 10px 14px 1px',
|
|
50
|
+
11: '0px 11px 15px 1px',
|
|
51
|
+
12: '0px 12px 17px 2px',
|
|
52
|
+
13: '0px 13px 19px 2px',
|
|
53
|
+
14: '0px 14px 21px 2px',
|
|
54
|
+
15: '0px 15px 22px 2px',
|
|
55
|
+
16: '0px 16px 24px 2px',
|
|
56
|
+
17: '0px 17px 26px 2px',
|
|
57
|
+
18: '0px 18px 28px 2px',
|
|
58
|
+
19: '0px 19px 29px 2px',
|
|
59
|
+
20: '0px 20px 31px 3px',
|
|
60
|
+
21: '0px 21px 33px 3px',
|
|
61
|
+
22: '0px 22px 35px 3px',
|
|
62
|
+
23: '0px 23px 36px 3px',
|
|
63
|
+
24: '0px 24px 38px 3px',
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
$_ambient-map: (
|
|
67
|
+
0: '0px 0px 0px 0px',
|
|
68
|
+
1: '0px 1px 3px 0px',
|
|
69
|
+
2: '0px 1px 5px 0px',
|
|
70
|
+
3: '0px 1px 8px 0px',
|
|
71
|
+
4: '0px 1px 10px 0px',
|
|
72
|
+
5: '0px 1px 14px 0px',
|
|
73
|
+
6: '0px 1px 18px 0px',
|
|
74
|
+
7: '0px 2px 16px 1px',
|
|
75
|
+
8: '0px 3px 14px 2px',
|
|
76
|
+
9: '0px 3px 16px 2px',
|
|
77
|
+
10: '0px 4px 18px 3px',
|
|
78
|
+
11: '0px 4px 20px 3px',
|
|
79
|
+
12: '0px 5px 22px 4px',
|
|
80
|
+
13: '0px 5px 24px 4px',
|
|
81
|
+
14: '0px 5px 26px 4px',
|
|
82
|
+
15: '0px 6px 28px 5px',
|
|
83
|
+
16: '0px 6px 30px 5px',
|
|
84
|
+
17: '0px 6px 32px 5px',
|
|
85
|
+
18: '0px 7px 34px 6px',
|
|
86
|
+
19: '0px 7px 36px 6px',
|
|
87
|
+
20: '0px 8px 38px 7px',
|
|
88
|
+
21: '0px 8px 40px 7px',
|
|
89
|
+
22: '0px 8px 42px 7px',
|
|
90
|
+
23: '0px 9px 44px 8px',
|
|
91
|
+
24: '0px 9px 46px 8px',
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// A collection of mixins and CSS classes that can be used to apply elevation to a material
|
|
95
|
+
// element.
|
|
96
|
+
// See: https://material.io/design/environment/elevation.html
|
|
97
|
+
// Examples:
|
|
98
|
+
//
|
|
99
|
+
//
|
|
100
|
+
// .mat-foo {
|
|
101
|
+
// @include $mat-elevation(2);
|
|
102
|
+
//
|
|
103
|
+
// &:active {
|
|
104
|
+
// @include $mat-elevation(8);
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
//
|
|
108
|
+
// <div id="external-card" class="mat-elevation-z2"><p>Some content</p></div>
|
|
109
|
+
//
|
|
110
|
+
// For an explanation of the design behind how elevation is implemented, see the design doc at
|
|
111
|
+
// https://goo.gl/Kq0k9Z.
|
|
112
|
+
|
|
113
|
+
// The default color for elevation shadows.
|
|
114
|
+
$color: black !default;
|
|
115
|
+
|
|
116
|
+
// Prefix for elevation-related selectors.
|
|
117
|
+
$prefix: 'mat-elevation-z';
|
|
118
|
+
|
|
119
|
+
// Applies the correct css rules to an element to give it the elevation specified by $zValue.
|
|
120
|
+
// The $zValue must be between 0 and 24.
|
|
121
|
+
@mixin elevation($zValue, $color: $color, $opacity: null) {
|
|
122
|
+
box-shadow: get-box-shadow($zValue, $color, $opacity);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Applies the elevation to an element in a manner that allows
|
|
126
|
+
// consumers to override it via the Material elevation classes.
|
|
127
|
+
@mixin overridable-elevation($zValue, $color: $color, $opacity: null) {
|
|
128
|
+
&:not([class*='#{$prefix}']) {
|
|
129
|
+
@include elevation($zValue, $color, $opacity);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Gets the box shadow value for a specific elevation.
|
|
134
|
+
@function get-box-shadow($zValue, $shadow-color: black, $opacity: null) {
|
|
135
|
+
@if $zValue == null {
|
|
136
|
+
@return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@if meta.type-of($zValue) != number or not math.is-unitless($zValue) {
|
|
140
|
+
@error '$zValue must be a unitless number, but received `#{$zValue}`';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@if $zValue < 0 or $zValue > 24 {
|
|
144
|
+
@error '$zValue must be between 0 and 24, but received `#{$zValue}`';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
$umbra-z-value: map.get($_umbra-map, $zValue);
|
|
148
|
+
$penumbra-z-value: map.get($_penumbra-map, $zValue);
|
|
149
|
+
$ambient-z-value: map.get($_ambient-map, $zValue);
|
|
150
|
+
|
|
151
|
+
$color-opacity: if($opacity != null, $opacity, 1);
|
|
152
|
+
$umbra-color: _compute-color-opacity($shadow-color, $_umbra-opacity * $color-opacity);
|
|
153
|
+
$penumbra-color: _compute-color-opacity($shadow-color, $_penumbra-opacity * $color-opacity);
|
|
154
|
+
$ambient-color: _compute-color-opacity($shadow-color, $_ambient-opacity * $color-opacity);
|
|
155
|
+
|
|
156
|
+
@return string.unquote('#{$umbra-z-value} #{$umbra-color}, #{$penumbra-z-value} ' +
|
|
157
|
+
'#{$penumbra-color}, #{$ambient-z-value} #{$ambient-color}');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@function _compute-color-opacity($color, $opacity) {
|
|
161
|
+
@if meta.type-of($color) == color and $opacity != null {
|
|
162
|
+
@return rgba($color, $opacity);
|
|
163
|
+
}
|
|
164
|
+
@else {
|
|
165
|
+
@return $color;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '@material/tokens/v0_161' as mdc-tokens;
|
|
3
2
|
@use '@angular/material' as mat;
|
|
4
3
|
@use './m3';
|
|
4
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
5
5
|
@use '../tokens/m2' as m2-tokens;
|
|
6
6
|
@use './density';
|
|
7
7
|
@use './format-tokens';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
23
|
-
///
|
|
23
|
+
/// ./m3/definitions/_md-ref-palette.scss)
|
|
24
24
|
/// @param {Map} $primary The primary palette
|
|
25
25
|
/// @param {Map} $secondary The secondary palette
|
|
26
26
|
/// @param {Map} $tertiary The tertiary palette
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
42
|
-
///
|
|
42
|
+
/// ./m3/definitions/_md-ref-typeface.scss)
|
|
43
43
|
/// @param {List|String} $brand The font-family to use for brand text
|
|
44
44
|
/// @param {List|String} $plain The font-family to use for plain text
|
|
45
45
|
/// @param {String} $bold The font-weight to use for bold text
|
|
@@ -126,8 +126,8 @@ $_cached-token-slots: null;
|
|
|
126
126
|
|
|
127
127
|
@function _get-sys-color($type, $ref) {
|
|
128
128
|
$mdc-sys-color: if($type == dark,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
m3-token-definitions.md-sys-color-values-dark($ref),
|
|
130
|
+
m3-token-definitions.md-sys-color-values-light($ref));
|
|
131
131
|
|
|
132
132
|
@if (mat.$private-use-system-color-variables) {
|
|
133
133
|
@return (
|
|
@@ -283,7 +283,7 @@ $_cached-token-slots: null;
|
|
|
283
283
|
'title-small-weight': var(--sys-title-small-weight),
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
|
-
@return
|
|
286
|
+
@return m3-token-definitions.md-sys-typescale-values($ref);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -306,12 +306,12 @@ $_cached-token-slots: null;
|
|
|
306
306
|
md-sys-color: $sys-color,
|
|
307
307
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
308
308
|
// elevation needs to be part of the color dimension.
|
|
309
|
-
md-sys-elevation:
|
|
309
|
+
md-sys-elevation: m3-token-definitions.md-sys-elevation-values(),
|
|
310
310
|
// Because the state values are sometimes combined with color values to create rgba colors,
|
|
311
311
|
// state needs to be part of color dimension.
|
|
312
312
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
313
313
|
// state to the base dimension.
|
|
314
|
-
md-sys-state:
|
|
314
|
+
md-sys-state: m3-token-definitions.md-sys-state-values(),
|
|
315
315
|
)));
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -347,7 +347,7 @@ $_cached-token-slots: null;
|
|
|
347
347
|
@function generate-base-tokens() {
|
|
348
348
|
// TODO(mmalerba): Exclude density tokens once implemented.
|
|
349
349
|
@return _generate-tokens((
|
|
350
|
-
md-sys-motion:
|
|
351
|
-
md-sys-shape:
|
|
350
|
+
md-sys-motion: m3-token-definitions.md-sys-motion-values(),
|
|
351
|
+
md-sys-shape: m3-token-definitions.md-sys-shape-values(),
|
|
352
352
|
), $include-non-systemized: true);
|
|
353
353
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
@use 'sass:list';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'sass:meta';
|
|
4
|
-
@use '
|
|
5
|
-
@use '
|
|
6
|
-
@use '
|
|
7
|
-
@use '@material/theme/keys' as mdc-keys;
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
@use 'sass:color';
|
|
6
|
+
@use 'sass:math';
|
|
8
7
|
@use '@angular/material' as mat;
|
|
9
|
-
@use '../
|
|
8
|
+
@use '../style/elevation';
|
|
9
|
+
@use '../m2/typography' as m2-typography;
|
|
10
10
|
|
|
11
11
|
// Indicates whether we're building internally. Used for backwards compatibility.
|
|
12
12
|
$private-is-internal-build: false;
|
|
@@ -24,7 +24,7 @@ $placeholder-color-config: (
|
|
|
24
24
|
background: mat.$m2-light-theme-background-palette,
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
$_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);
|
|
27
|
+
$_placeholder-typography-level-config: m2-typography.typography-config-level-from-mdc(body1);
|
|
28
28
|
|
|
29
29
|
// Placeholder typography config that can be passed to token getter functions when generating token
|
|
30
30
|
// slots.
|
|
@@ -54,27 +54,33 @@ $placeholder-density-config: 0;
|
|
|
54
54
|
$_tokens: null;
|
|
55
55
|
$_component-prefix: null;
|
|
56
56
|
|
|
57
|
-
@mixin _configure-token-prefix($first, $rest...) {
|
|
58
|
-
$_component-prefix: '' !global;
|
|
59
|
-
@each $item in $rest {
|
|
60
|
-
$_component-prefix:
|
|
61
|
-
if($_component-prefix == '', $item, '#{$_component-prefix}-#{$item}') !global;
|
|
62
|
-
}
|
|
63
|
-
@include mdc-custom-properties.configure($varname-prefix: $first) {
|
|
64
|
-
@content;
|
|
65
|
-
}
|
|
66
|
-
$_component-prefix: null !global;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
57
|
// Sets the token prefix and map to use when creating token slots.
|
|
70
58
|
@mixin use-tokens($prefix, $tokens) {
|
|
59
|
+
$_component-prefix: $prefix !global;
|
|
71
60
|
$_tokens: $tokens !global;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
|
|
62
|
+
@content;
|
|
63
|
+
|
|
64
|
+
$_component-prefix: null !global;
|
|
75
65
|
$_tokens: null !global;
|
|
76
66
|
}
|
|
77
67
|
|
|
68
|
+
// Combines a prefix and a string to generate a CSS variable name for a token.
|
|
69
|
+
@function _get-css-variable($prefix, $name) {
|
|
70
|
+
@if $prefix == null or $name == null {
|
|
71
|
+
@error 'Must specify both prefix and name when generating token';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
$string-prefix: '';
|
|
75
|
+
|
|
76
|
+
// Prefixes are lists so we need to combine them.
|
|
77
|
+
@each $part in $prefix {
|
|
78
|
+
$string-prefix: if($string-prefix == '', $part, '#{$string-prefix}-#{$part}');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@return string.unquote('--#{$string-prefix}-#{$name}');
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
// Emits a slot for the given token, provided that it has a non-null value in the token map passed
|
|
79
85
|
// to `use-tokens`.
|
|
80
86
|
@mixin create-token-slot($property, $token, $emit-fallback: false) {
|
|
@@ -94,8 +100,10 @@ $_component-prefix: null;
|
|
|
94
100
|
$fallback: $emit-fallback;
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
$
|
|
98
|
-
|
|
103
|
+
$var-name: _get-css-variable($_component-prefix, $token);
|
|
104
|
+
$var-reference: if($fallback == null, var(#{$var-name}), var(#{$var-name}, #{$fallback}));
|
|
105
|
+
|
|
106
|
+
#{$property}: #{$var-reference};
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
|
|
@@ -109,7 +117,7 @@ $_component-prefix: null;
|
|
|
109
117
|
@error 'Token #{$token} does not exist. Configured tokens are: #{map.keys($_tokens)}';
|
|
110
118
|
}
|
|
111
119
|
|
|
112
|
-
@return
|
|
120
|
+
@return _get-css-variable($_component-prefix, $token);
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
// TODO(crisbeto): should be able to replace the usages of `get-token-variable` with this.
|
|
@@ -134,12 +142,29 @@ $_component-prefix: null;
|
|
|
134
142
|
}
|
|
135
143
|
}
|
|
136
144
|
|
|
145
|
+
// Outputs a map of tokens under a specific prefix.
|
|
137
146
|
@mixin create-token-values($prefix, $tokens) {
|
|
138
|
-
@
|
|
139
|
-
@
|
|
147
|
+
@if $tokens != null {
|
|
148
|
+
@each $key, $value in $tokens {
|
|
149
|
+
@if $value != null {
|
|
150
|
+
#{_get-css-variable($prefix, $key)}: #{$value};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
140
153
|
}
|
|
141
154
|
}
|
|
142
155
|
|
|
156
|
+
/// Gets all the MDC token values for a specific component. This function serves as single
|
|
157
|
+
/// point at which we directly reference a specific version of the MDC tokens.
|
|
158
|
+
/// @param {String} $component Name of the component for which to get the tokens
|
|
159
|
+
/// @param {Map} $systems The MDC system tokens
|
|
160
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
161
|
+
/// @return {List} Map of token names to values
|
|
162
|
+
@function get-mdc-tokens($component, $systems, $exclude-hardcoded) {
|
|
163
|
+
$full-name: 'md-comp-' + $component + '-values';
|
|
164
|
+
$fn: meta.get-function($name: $full-name, $module: 'm3-token-definitions');
|
|
165
|
+
@return meta.call($fn, $systems, $exclude-hardcoded);
|
|
166
|
+
}
|
|
167
|
+
|
|
143
168
|
// MDC doesn't currently handle elevation tokens properly. As a temporary workaround we can combine
|
|
144
169
|
// the elevation and shadow-color tokens into a full box-shadow and use it as the value for the
|
|
145
170
|
// elevation token.
|
|
@@ -147,7 +172,7 @@ $_component-prefix: null;
|
|
|
147
172
|
$elevation: map.get($tokens, $elevation-token);
|
|
148
173
|
$shadow-color: map.get($tokens, $shadow-color-token);
|
|
149
174
|
@return map.merge($tokens, (
|
|
150
|
-
$elevation-token:
|
|
175
|
+
$elevation-token: elevation.get-box-shadow($elevation, $shadow-color),
|
|
151
176
|
$shadow-color-token: null,
|
|
152
177
|
));
|
|
153
178
|
}
|
|
@@ -202,9 +227,13 @@ $_component-prefix: null;
|
|
|
202
227
|
}
|
|
203
228
|
$overrides: map.get($tokens, list.append($prefix, $color-variant));
|
|
204
229
|
@if $overrides == null {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
230
|
+
$variants: _supported-color-variants($tokens, $prefix);
|
|
231
|
+
$secondary-message: if($variants == (),
|
|
232
|
+
'Mixin does not support color variants',
|
|
233
|
+
'Supported color variants are: #{$variants}'
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
@error 'Invalid color variant: #{$color-variant}. #{$secondary-message}.';
|
|
208
237
|
}
|
|
209
238
|
@return if($emit-overrides-only, $overrides, map.merge($values, $overrides));
|
|
210
239
|
}
|
|
@@ -286,6 +315,7 @@ $_component-prefix: null;
|
|
|
286
315
|
/// @param {Map} $map The maps whose values will be mapped to new values.
|
|
287
316
|
/// @param {Function} $fn The value mapping function.
|
|
288
317
|
/// @param {Map} A new map with its values updated using the mapping function.
|
|
318
|
+
/* stylelint-disable-next-line scss/no-global-function-names */
|
|
289
319
|
@function map-values($map, $fn) {
|
|
290
320
|
$result: ();
|
|
291
321
|
@each $key, $value in $map {
|
|
@@ -339,6 +369,66 @@ $_component-prefix: null;
|
|
|
339
369
|
@return $result;
|
|
340
370
|
}
|
|
341
371
|
|
|
372
|
+
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
|
|
373
|
+
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
|
|
374
|
+
/// backwards compatibility.
|
|
375
|
+
/// @param {Color} $value Color for which we're calculating the contrast tone.
|
|
376
|
+
/// @param {Boolean} $is-dark Whether the current theme is dark.
|
|
377
|
+
/// @return {Map} Either `dark` or `light`.
|
|
378
|
+
@function contrast-tone($value, $is-dark) {
|
|
379
|
+
@if ($value == 'dark') {
|
|
380
|
+
@return 'light';
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@if ($value == 'light') {
|
|
384
|
+
@return 'dark';
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Fallback if the app is using a non-color palette (e.g. CSS variable based).
|
|
388
|
+
@if (meta.type-of($value) != 'color') {
|
|
389
|
+
@return if($is-dark, 'light', 'dark');
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
$minimum-contrast: 3.1;
|
|
393
|
+
$light-contrast: _contrast($value, #fff);
|
|
394
|
+
$dark-contrast: _contrast($value, rgba(0, 0, 0, 0.87));
|
|
395
|
+
|
|
396
|
+
@if ($light-contrast < $minimum-contrast) and ($dark-contrast > $light-contrast) {
|
|
397
|
+
@return 'dark';
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
@return 'light';
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@function _linear-channel-value($channel-value) {
|
|
404
|
+
$normalized-channel-value: math.div($channel-value, 255);
|
|
405
|
+
|
|
406
|
+
@if ($normalized-channel-value < 0.03928) {
|
|
407
|
+
@return math.div($normalized-channel-value, 12.92);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@return math.pow(math.div($normalized-channel-value + 0.055, 1.055), 2.4);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Calculate the luminance for a color.
|
|
414
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
415
|
+
@function _luminance($color) {
|
|
416
|
+
$red: _linear-channel-value(color.red($color));
|
|
417
|
+
$green: _linear-channel-value(color.green($color));
|
|
418
|
+
$blue: _linear-channel-value(color.blue($color));
|
|
419
|
+
|
|
420
|
+
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Calculate the contrast ratio between two colors.
|
|
424
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
425
|
+
@function _contrast($back, $front) {
|
|
426
|
+
$back-lum: _luminance($back) + 0.05;
|
|
427
|
+
$fore-lum: _luminance($front) + 0.05;
|
|
428
|
+
|
|
429
|
+
@return math.div(math.max($back-lum, $fore-lum), math.min($back-lum, $fore-lum));
|
|
430
|
+
}
|
|
431
|
+
|
|
342
432
|
/// Verifies that the token overrides exist and are used in one of the given token maps.
|
|
343
433
|
@mixin _validate-token-overrides($overrides: (), $token-maps) {
|
|
344
434
|
$valid-token-names: ();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'sass:meta';
|
|
4
|
-
@use '@material/elevation/elevation-theme' as mdc-elevation;
|
|
5
4
|
@use '@angular/material' as mat;
|
|
6
5
|
@use '../../token-utils';
|
|
6
|
+
@use '../../../style/elevation';
|
|
7
7
|
|
|
8
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
9
|
$prefix: (mtx, datetimepicker);
|
|
@@ -56,8 +56,8 @@ $_today-fade-amount: .2;
|
|
|
56
56
|
// but may be in a future version of the theming API.
|
|
57
57
|
@function get-unthemable-tokens() {
|
|
58
58
|
@return (
|
|
59
|
-
container-elevation-shadow:
|
|
60
|
-
container-touch-elevation-shadow:
|
|
59
|
+
container-elevation-shadow: elevation.get-box-shadow(4),
|
|
60
|
+
container-touch-elevation-shadow: elevation.get-box-shadow(24),
|
|
61
61
|
container-shape: 4px,
|
|
62
62
|
container-touch-shape: 4px,
|
|
63
63
|
selector-container-shape: 4px,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@angular/material' as mat;
|
|
3
|
-
@use '@material/elevation' as mdc-elevation;
|
|
4
3
|
@use '../../token-utils';
|
|
4
|
+
@use '../../../style/elevation';
|
|
5
5
|
|
|
6
6
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
7
7
|
$prefix: (mtx, drawer);
|
|
@@ -11,7 +11,7 @@ $prefix: (mtx, drawer);
|
|
|
11
11
|
@function get-unthemable-tokens() {
|
|
12
12
|
@return (
|
|
13
13
|
container-shape: 0,
|
|
14
|
-
container-elevation-shadow:
|
|
14
|
+
container-elevation-shadow: elevation.get-box-shadow(16),
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
|