@ng-matero/extensions 18.0.3 → 18.1.1
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/README.md +27 -2
- package/alert/alert.scss +13 -16
- package/colorpicker/colorpicker-toggle.scss +1 -1
- package/colorpicker/colorpicker.d.ts +1 -1
- package/column-resize/resize-strategy.d.ts +1 -1
- package/core/m2/_typography.scss +172 -0
- package/core/pipes/is-template-ref.pipe.d.ts +2 -2
- package/core/style/_elevation.scss +167 -0
- package/core/tokens/_m3-tokens.scss +13 -10
- package/core/tokens/_token-utils.scss +120 -30
- package/core/tokens/m2/mtx/_alert.scss +17 -9
- package/core/tokens/m2/mtx/_datetimepicker.scss +3 -3
- package/core/tokens/m2/mtx/_drawer.scss +2 -2
- package/core/tokens/m2/mtx/_grid.scss +0 -2
- package/core/tokens/m2/mtx/_popover.scss +3 -0
- 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/_alert.scss +19 -9
- package/core/tokens/m3/mtx/_datetimepicker.scss +3 -3
- package/core/tokens/m3/mtx/_drawer.scss +2 -2
- package/core/tokens/m3/mtx/_grid.scss +0 -2
- package/core/tokens/m3/mtx/_popover.scss +3 -0
- package/core/tokens/m3/mtx/_select.scss +2 -2
- package/core/typography/_all-typography.scss +2 -2
- package/datetimepicker/calendar.d.ts +4 -2
- package/datetimepicker/calendar.scss +38 -0
- package/datetimepicker/datetimepicker-actions.d.ts +32 -0
- package/datetimepicker/datetimepicker-actions.scss +18 -0
- package/datetimepicker/datetimepicker-animations.d.ts +1 -1
- package/datetimepicker/datetimepicker-content.scss +40 -22
- package/datetimepicker/datetimepicker-module.d.ts +2 -1
- package/datetimepicker/datetimepicker-toggle.scss +1 -1
- package/datetimepicker/datetimepicker.d.ts +33 -3
- package/datetimepicker/public-api.d.ts +1 -0
- package/datetimepicker/time.d.ts +12 -8
- package/datetimepicker/time.scss +6 -6
- package/dialog/dialog.d.ts +1 -1
- package/drawer/drawer-config.d.ts +8 -6
- package/drawer/drawer-container.d.ts +12 -68
- package/drawer/drawer-container.scss +4 -6
- package/drawer/drawer-module.d.ts +2 -2
- package/drawer/drawer-ref.d.ts +13 -4
- package/drawer/drawer.d.ts +24 -24
- package/esm2022/alert/alert-module.mjs +5 -5
- package/esm2022/alert/alert.mjs +6 -5
- 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 +8 -8
- 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 +10 -6
- package/esm2022/datetimepicker/clock.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-actions.mjs +88 -0
- package/esm2022/datetimepicker/datetimepicker-animations.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-input.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
- package/esm2022/datetimepicker/datetimepicker-module.mjs +24 -7
- package/esm2022/datetimepicker/datetimepicker-toggle.mjs +6 -6
- package/esm2022/datetimepicker/datetimepicker.mjs +92 -20
- package/esm2022/datetimepicker/month-view.mjs +7 -5
- package/esm2022/datetimepicker/multi-year-view.mjs +7 -5
- package/esm2022/datetimepicker/public-api.mjs +2 -1
- package/esm2022/datetimepicker/time.mjs +29 -20
- package/esm2022/datetimepicker/year-view.mjs +7 -5
- 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-config.mjs +2 -2
- package/esm2022/drawer/drawer-container.mjs +32 -196
- package/esm2022/drawer/drawer-module.mjs +7 -7
- package/esm2022/drawer/drawer-ref.mjs +27 -18
- package/esm2022/drawer/drawer.mjs +98 -121
- package/esm2022/grid/cell.mjs +3 -3
- package/esm2022/grid/column-menu.mjs +5 -5
- 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 +5 -5
- 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-interfaces.mjs +1 -1
- 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 +29 -19
- 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 +20 -18
- package/fesm2022/mtxAlert.mjs +9 -8
- package/fesm2022/mtxAlert.mjs.map +1 -1
- package/fesm2022/mtxButton.mjs +7 -7
- package/fesm2022/mtxCheckboxGroup.mjs +7 -7
- package/fesm2022/mtxColorpicker.mjs +20 -20
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +40 -40
- package/fesm2022/mtxCore.mjs +21 -21
- package/fesm2022/mtxDatetimepicker.mjs +273 -82
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +10 -10
- package/fesm2022/mtxDrawer.mjs +160 -340
- package/fesm2022/mtxDrawer.mjs.map +1 -1
- package/fesm2022/mtxGrid.mjs +68 -68
- package/fesm2022/mtxGrid.mjs.map +1 -1
- package/fesm2022/mtxLoader.mjs +7 -7
- package/fesm2022/mtxPhotoviewer.mjs +7 -7
- package/fesm2022/mtxPopover.mjs +44 -34
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxProgress.mjs +7 -7
- package/fesm2022/mtxSelect.mjs +43 -43
- package/fesm2022/mtxSplit.mjs +10 -10
- package/fesm2022/mtxTooltip.mjs +23 -21
- package/fesm2022/mtxTooltip.mjs.map +1 -1
- package/grid/column-menu.scss +0 -1
- package/grid/grid.scss +2 -0
- package/package.json +7 -7
- package/popover/popover-interfaces.d.ts +0 -1
- package/popover/popover.d.ts +2 -5
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/select/option.d.ts +1 -1
- package/select/select.scss +2 -2
- package/tooltip/_tooltip-theme.scss +19 -15
- package/tooltip/tooltip.d.ts +3 -0
- package/tooltip/tooltip.scss +61 -29
- package/core/typography/_typography.scss +0 -40
package/README.md
CHANGED
|
@@ -43,18 +43,43 @@ export class YourAppModule {
|
|
|
43
43
|
|
|
44
44
|
After import modules, you must define a theme. [More about theming](https://material.angular.io/guide/theming).
|
|
45
45
|
|
|
46
|
+
### M2 theme
|
|
47
|
+
|
|
46
48
|
```scss
|
|
49
|
+
@use '@angular/material' as mat;
|
|
47
50
|
@use '@ng-matero/extensions' as mtx;
|
|
48
51
|
|
|
52
|
+
$theme: mat.define-light-theme(...);
|
|
53
|
+
|
|
54
|
+
@include mat.all-component-themes($theme);
|
|
49
55
|
@include mtx.all-component-themes($theme);
|
|
50
56
|
```
|
|
51
57
|
|
|
58
|
+
### M3 theme
|
|
59
|
+
|
|
60
|
+
```scss
|
|
61
|
+
@use '@angular/material' as mat;
|
|
62
|
+
@use '@ng-matero/extensions' as mtx;
|
|
63
|
+
|
|
64
|
+
$config: (...);
|
|
65
|
+
|
|
66
|
+
$theme: mat.private-deep-merge-all(
|
|
67
|
+
mat.define-theme($config),
|
|
68
|
+
mtx.define-theme($config)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
html {
|
|
72
|
+
@include mat.all-component-themes($theme);
|
|
73
|
+
@include mtx.all-component-themes($theme);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
52
77
|
The @use-based Sass API is only available in the version `12.0.0` and above.
|
|
53
78
|
|
|
54
|
-
You can also [using a pre-built theme](https://material.angular.io/guide/theming#
|
|
79
|
+
You can also [using a pre-built theme](https://material.angular.io/guide/theming#pre-built-themes) which in the "prebuilt-themes" directory of the npm package (@ng-matero/extensions/prebuilt-themes).
|
|
55
80
|
|
|
56
81
|
```scss
|
|
57
|
-
@import '@ng-matero/extensions/prebuilt-themes/
|
|
82
|
+
@import '@ng-matero/extensions/prebuilt-themes/azure-blue.css'
|
|
58
83
|
```
|
|
59
84
|
|
|
60
85
|
## Development
|
package/alert/alert.scss
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
.mtx-alert {
|
|
5
5
|
position: relative;
|
|
6
6
|
display: block;
|
|
7
|
-
padding:
|
|
8
|
-
margin-bottom:
|
|
7
|
+
padding: .75rem 1rem;
|
|
8
|
+
margin-bottom: 1rem;
|
|
9
|
+
line-height: 1.5;
|
|
9
10
|
|
|
10
11
|
@include token-utils.use-tokens(tokens-mtx-alert.$prefix, tokens-mtx-alert.get-token-slots()) {
|
|
11
12
|
$border-color: token-utils.get-token-variable(outline-color);
|
|
@@ -17,21 +18,25 @@
|
|
|
17
18
|
@include token-utils.create-token-slot(color, text-color);
|
|
18
19
|
|
|
19
20
|
&.mtx-alert-info {
|
|
21
|
+
@include token-utils.create-token-slot(border-color, info-outline-color);
|
|
20
22
|
@include token-utils.create-token-slot(background-color, info-background-color);
|
|
21
23
|
@include token-utils.create-token-slot(color, info-text-color);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
&.mtx-alert-success {
|
|
27
|
+
@include token-utils.create-token-slot(border-color, success-outline-color);
|
|
25
28
|
@include token-utils.create-token-slot(background-color, success-background-color);
|
|
26
29
|
@include token-utils.create-token-slot(color, success-text-color);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
&.mtx-alert-warning {
|
|
33
|
+
@include token-utils.create-token-slot(border-color, warning-outline-color);
|
|
30
34
|
@include token-utils.create-token-slot(background-color, warning-background-color);
|
|
31
35
|
@include token-utils.create-token-slot(color, warning-text-color);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
&.mtx-alert-danger {
|
|
39
|
+
@include token-utils.create-token-slot(border-color, danger-outline-color);
|
|
35
40
|
@include token-utils.create-token-slot(background-color, danger-background-color);
|
|
36
41
|
@include token-utils.create-token-slot(color, danger-text-color);
|
|
37
42
|
}
|
|
@@ -41,27 +46,19 @@
|
|
|
41
46
|
.mtx-alert-close {
|
|
42
47
|
position: absolute;
|
|
43
48
|
top: 0;
|
|
44
|
-
bottom: 0;
|
|
45
49
|
right: 0;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
border: 0;
|
|
53
|
-
cursor: pointer;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
width: 3rem;
|
|
54
|
+
height: 3rem;
|
|
54
55
|
|
|
55
56
|
[dir='rtl'] & {
|
|
56
57
|
right: auto;
|
|
57
58
|
left: 0;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
&:hover {
|
|
61
|
-
opacity: .75;
|
|
62
|
-
}
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
.mtx-alert-dismissible {
|
|
66
|
-
padding-right:
|
|
63
|
+
padding-right: 3rem;
|
|
67
64
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
$_tokens: tokens-mtx-colorpicker.$prefix, tokens-mtx-colorpicker.get-token-slots();
|
|
6
6
|
|
|
7
|
-
// We support the case where the form field is disabled, but the
|
|
7
|
+
// We support the case where the form field is disabled, but the colorpicker is not.
|
|
8
8
|
// MDC sets `pointer-events: none` on disabled form fields which prevents clicks on the toggle.
|
|
9
9
|
.mtx-colorpicker-toggle {
|
|
10
10
|
pointer-events: auto;
|
|
@@ -87,7 +87,7 @@ export declare class MtxColorpicker implements OnChanges, OnDestroy {
|
|
|
87
87
|
private _backdropHarnessClass;
|
|
88
88
|
/** The input element this colorpicker is associated with. */
|
|
89
89
|
pickerInput: MtxColorpickerInput;
|
|
90
|
-
/** Emits when the
|
|
90
|
+
/** Emits when the colorpicker is disabled. */
|
|
91
91
|
readonly _disabledChange: Subject<boolean>;
|
|
92
92
|
/** Emits new selected color when selected color changes. */
|
|
93
93
|
readonly _selectedChanged: Subject<string>;
|
|
@@ -65,7 +65,7 @@ export declare class CdkFlexTableResizeStrategy extends ResizeStrategy implement
|
|
|
65
65
|
private _indexSequence;
|
|
66
66
|
protected readonly defaultMinSize = 0;
|
|
67
67
|
protected readonly defaultMaxSize: number;
|
|
68
|
-
constructor(columnResize: ColumnResize, styleScheduler: _CoalescedStyleScheduler, table: CdkTable<unknown>, document: any, _nonce?: string | null | undefined);
|
|
68
|
+
constructor(columnResize: ColumnResize, styleScheduler: _CoalescedStyleScheduler, table: CdkTable<unknown>, document: any, _nonce?: (string | null) | undefined);
|
|
69
69
|
applyColumnSize(cssFriendlyColumnName: string, columnHeader: HTMLElement, sizeInPx: number, previousSizeInPx?: number): void;
|
|
70
70
|
applyMinColumnSize(cssFriendlyColumnName: string, _: HTMLElement, sizeInPx: number): void;
|
|
71
71
|
applyMaxColumnSize(cssFriendlyColumnName: string, _: HTMLElement, sizeInPx: number): void;
|
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
1
|
+
import { PipeTransform, TemplateRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class MtxIsTemplateRefPipe implements PipeTransform {
|
|
4
|
-
transform(obj: any):
|
|
4
|
+
transform(obj: any): obj is TemplateRef<any>;
|
|
5
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<MtxIsTemplateRefPipe, never>;
|
|
6
6
|
static ɵpipe: i0.ɵɵPipeDeclaration<MtxIsTemplateRefPipe, "isTemplateRef", true>;
|
|
7
7
|
}
|
|
@@ -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.
|
|
@@ -300,15 +300,18 @@ $_cached-token-slots: null;
|
|
|
300
300
|
$sys-color: _get-sys-color($type, $ref);
|
|
301
301
|
|
|
302
302
|
@return _generate-tokens(map.merge($ref, (
|
|
303
|
+
// Used to get the theme type
|
|
304
|
+
md-sys-type: $type,
|
|
305
|
+
|
|
303
306
|
md-sys-color: $sys-color,
|
|
304
307
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
305
308
|
// elevation needs to be part of the color dimension.
|
|
306
|
-
md-sys-elevation:
|
|
309
|
+
md-sys-elevation: m3-token-definitions.md-sys-elevation-values(),
|
|
307
310
|
// Because the state values are sometimes combined with color values to create rgba colors,
|
|
308
311
|
// state needs to be part of color dimension.
|
|
309
312
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
310
313
|
// state to the base dimension.
|
|
311
|
-
md-sys-state:
|
|
314
|
+
md-sys-state: m3-token-definitions.md-sys-state-values(),
|
|
312
315
|
)));
|
|
313
316
|
}
|
|
314
317
|
|
|
@@ -344,7 +347,7 @@ $_cached-token-slots: null;
|
|
|
344
347
|
@function generate-base-tokens() {
|
|
345
348
|
// TODO(mmalerba): Exclude density tokens once implemented.
|
|
346
349
|
@return _generate-tokens((
|
|
347
|
-
md-sys-motion:
|
|
348
|
-
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(),
|
|
349
352
|
), $include-non-systemized: true);
|
|
350
353
|
}
|