@ng-matero/extensions 17.3.5 → 18.0.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 +11 -0
- package/_index.scss +6 -0
- package/alert/_alert-theme.scss +2 -3
- package/colorpicker/_colorpicker-theme.scss +2 -3
- package/colorpicker/colorpicker.d.ts +4 -4
- package/{experimental/theming/_color-api-back-compat.scss → core/theming/_color-api-backwards-compatibility.scss} +1 -1
- package/{experimental → core}/theming/_config-validation.scss +11 -5
- package/{experimental → core}/theming/_definition.scss +4 -3
- package/core/theming/prebuilt/azure-blue.scss +26 -0
- package/core/theming/prebuilt/cyan-orange.scss +26 -0
- package/core/theming/prebuilt/deeppurple-amber.scss +4 -4
- package/core/theming/prebuilt/indigo-pink.scss +4 -4
- package/core/theming/prebuilt/magenta-violet.scss +26 -0
- package/core/theming/prebuilt/pink-bluegrey.scss +4 -4
- package/core/theming/prebuilt/purple-green.scss +4 -4
- package/core/theming/prebuilt/rose-red.scss +26 -0
- package/{experimental/theming/_m3-density.scss → core/tokens/_density.scss} +0 -1
- package/core/tokens/_m3-tokens.scss +350 -0
- package/core/tokens/_token-utils.scss +164 -40
- package/core/tokens/m2/_index.scss +2 -3
- package/core/tokens/m2/mdc/_plain-tooltip.scss +1 -2
- package/core/tokens/m2/mtx/_alert.scss +5 -6
- package/core/tokens/m2/mtx/_colorpicker.scss +2 -3
- package/core/tokens/m2/mtx/_datetimepicker.scss +7 -8
- package/core/tokens/m2/mtx/_drawer.scss +3 -2
- package/core/tokens/m2/mtx/_grid.scss +4 -3
- package/core/tokens/m2/mtx/_loader.scss +2 -3
- package/core/tokens/m2/mtx/_popover.scss +1 -2
- package/core/tokens/m2/mtx/_progress.scss +5 -6
- package/core/tokens/m2/mtx/_select.scss +3 -2
- package/core/tokens/m2/mtx/_split.scss +2 -3
- package/core/tokens/m3/index.scss +45 -0
- package/core/tokens/m3/mtx/_alert.scss +31 -0
- package/core/tokens/m3/mtx/_colorpicker.scss +19 -0
- package/{experimental/theming/_custom-tokens.scss → core/tokens/m3/mtx/_datetimepicker.scss} +15 -191
- package/core/tokens/m3/mtx/_drawer.scss +22 -0
- package/core/tokens/m3/mtx/_grid.scss +34 -0
- package/core/tokens/m3/mtx/_loader.scss +22 -0
- package/core/tokens/m3/mtx/_popover.scss +22 -0
- package/core/tokens/m3/mtx/_progress.scss +31 -0
- package/core/tokens/m3/mtx/_select.scss +72 -0
- package/core/tokens/m3/mtx/_split.scss +30 -0
- package/datetimepicker/_datetimepicker-theme.scss +3 -4
- package/datetimepicker/calendar-body.scss +2 -2
- package/datetimepicker/calendar.d.ts +1 -0
- package/datetimepicker/datetimepicker-content.scss +0 -2
- package/datetimepicker/datetimepicker.d.ts +4 -4
- package/drawer/_drawer-theme.scss +2 -3
- package/drawer/drawer-container.scss +1 -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 +14 -12
- 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 +9 -14
- package/esm2022/datetimepicker/clock.mjs +5 -5
- 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 +15 -13
- package/esm2022/datetimepicker/month-view.mjs +3 -3
- package/esm2022/datetimepicker/multi-year-view.mjs +3 -3
- package/esm2022/datetimepicker/time.mjs +6 -6
- 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 +5 -5
- 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 +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 +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 +6 -8
- package/esm2022/popover/popover.mjs +6 -6
- 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 +37 -23
- package/esm2022/select/templates.mjs +33 -33
- package/esm2022/split/split-module.mjs +4 -4
- package/esm2022/split/split-pane.mjs +37 -28
- package/esm2022/split/split.mjs +55 -49
- package/esm2022/split/utils.mjs +1 -4
- 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 +27 -25
- package/fesm2022/mtxColorpicker.mjs.map +1 -1
- package/fesm2022/mtxColumnResize.mjs +40 -40
- package/fesm2022/mtxCore.mjs +21 -21
- package/fesm2022/mtxDatetimepicker.mjs +61 -63
- package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2022/mtxDialog.mjs +10 -10
- package/fesm2022/mtxDrawer.mjs +13 -13
- 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 +24 -26
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxProgress.mjs +7 -7
- package/fesm2022/mtxSelect.mjs +76 -62
- package/fesm2022/mtxSelect.mjs.map +1 -1
- package/fesm2022/mtxSplit.mjs +92 -80
- package/fesm2022/mtxSplit.mjs.map +1 -1
- package/fesm2022/mtxTooltip.mjs +12 -12
- package/grid/_grid-theme.scss +3 -4
- package/grid/column-menu.scss +15 -9
- package/grid/grid.scss +2 -2
- package/loader/_loader-theme.scss +2 -3
- package/package.json +18 -18
- package/popover/_popover-theme.scss +2 -3
- package/popover/popover.d.ts +2 -2
- package/prebuilt-themes/azure-blue.css +1 -0
- package/prebuilt-themes/cyan-orange.css +1 -0
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -0
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -0
- package/progress/_progress-theme.scss +3 -4
- package/select/_select-theme.scss +3 -4
- package/select/select.d.ts +17 -2
- package/select/select.scss +2 -4
- package/split/_split-theme.scss +2 -3
- package/split/split-pane.d.ts +29 -13
- package/split/split.d.ts +44 -20
- package/split/utils.d.ts +0 -1
- package/tooltip/_tooltip-theme.scss +4 -5
- package/core/style/_sass-utils.scss +0 -80
- package/experimental/_index.scss +0 -5
- package/experimental/theming/_m3-tokens.scss +0 -308
- /package/{experimental/theming → core/tokens}/_format-tokens.scss +0 -0
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
@use 'sass:list';
|
|
2
|
-
@use 'sass:map';
|
|
3
|
-
@use 'sass:meta';
|
|
4
|
-
@use '@angular/material' as mat;
|
|
5
|
-
@use '@material/tokens/v0_161' as mdc-tokens;
|
|
6
|
-
@use './m3-density';
|
|
7
|
-
@use './custom-tokens';
|
|
8
|
-
@use './format-tokens';
|
|
9
|
-
@use '../../core/tokens/m2';
|
|
10
|
-
|
|
11
|
-
/// Picks a submap containing only the given keys out the given map.
|
|
12
|
-
/// @param {Map} $map The map to pick from.
|
|
13
|
-
/// @param {List} $keys The map keys to pick.
|
|
14
|
-
/// @return {Map} A submap containing only the given keys.
|
|
15
|
-
@function _pick($map, $keys) {
|
|
16
|
-
$result: ();
|
|
17
|
-
@each $key in $keys {
|
|
18
|
-
@if map.has-key($map, $key) {
|
|
19
|
-
$result: map.set($result, $key, map.get($map, $key));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
@return $result;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/// Filters keys with a null value out of the map.
|
|
26
|
-
/// @param {Map} $map The map to filter.
|
|
27
|
-
/// @return {Map} The given map with all of the null keys filtered out.
|
|
28
|
-
@function _filter-nulls($map) {
|
|
29
|
-
$result: ();
|
|
30
|
-
@each $key, $val in $map {
|
|
31
|
-
@if $val != null {
|
|
32
|
-
$result: map.set($result, $key, $val);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
@return $result;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
|
|
39
|
-
/// @param {List} $prefix The token prefix for the given tokens.
|
|
40
|
-
/// @param {Map|(Map, Map)} $m3-values A map of M3 token values for the given prefix.
|
|
41
|
-
/// This param may also be a tuple of maps, the first one representing the default M3 token values,
|
|
42
|
-
// and the second containing overrides for different color variants.
|
|
43
|
-
// Single map example:
|
|
44
|
-
// (token1: green, token2: 2px)
|
|
45
|
-
// Tuple example:
|
|
46
|
-
// (
|
|
47
|
-
// (token1: green, token2: 2px),
|
|
48
|
-
// (
|
|
49
|
-
// secondary: (token1: blue),
|
|
50
|
-
// error: (token1: red),
|
|
51
|
-
// )
|
|
52
|
-
// )
|
|
53
|
-
/// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
|
|
54
|
-
/// @param {String|null} $variant The name of the variant the token values are for.
|
|
55
|
-
/// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
|
|
56
|
-
@function _namespace-tokens($prefix, $m3-values, $slots, $variant: null) {
|
|
57
|
-
$result: ();
|
|
58
|
-
@if $variant == null and meta.type-of($m3-values) == 'list' and list.length($m3-values == 2) {
|
|
59
|
-
$variants: list.nth($m3-values, 2);
|
|
60
|
-
$m3-values: list.nth($m3-values, 1);
|
|
61
|
-
@each $variant, $overrides in $variants {
|
|
62
|
-
$result: map.merge($result, _namespace-tokens($prefix, $overrides, $slots, $variant));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
$used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
|
|
66
|
-
$used-m3-tokens: _pick(_filter-nulls($m3-values), $used-token-names);
|
|
67
|
-
$prefix: if($variant == null, $prefix, list.append($prefix, $variant));
|
|
68
|
-
@return map.merge($result, ($prefix: $used-m3-tokens));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// Generates tokens for the given palette with the given prefix.
|
|
72
|
-
/// @param {Map} $palette The palette to generate tokens for
|
|
73
|
-
/// @param {String} $prefix The key prefix used to name the tokens
|
|
74
|
-
/// @return {Map} A set of tokens for the given palette
|
|
75
|
-
@function _generate-palette-tokens($palette, $prefix) {
|
|
76
|
-
$palette: map.remove($palette, neutral, neutral-variant);
|
|
77
|
-
$result: ();
|
|
78
|
-
@each $hue, $value in $palette {
|
|
79
|
-
$result: map.set($result, '#{$prefix}#{$hue}', $value);
|
|
80
|
-
}
|
|
81
|
-
@return $result;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
85
|
-
/// https://github.com/material-components/material-components-web/blob/master/packages/mdc-tokens/v0_161/_md-ref-palette.scss)
|
|
86
|
-
/// @param {Map} $primary The primary palette
|
|
87
|
-
/// @param {Map} $secondary The secondary palette
|
|
88
|
-
/// @param {Map} $tertiary The tertiary palette
|
|
89
|
-
/// @param {Map} $error The error palette
|
|
90
|
-
/// @return {Map} A set of `md-ref-palette` tokens
|
|
91
|
-
@function _generate-ref-palette-tokens($primary, $tertiary, $error) {
|
|
92
|
-
@return mat.private-merge-all(
|
|
93
|
-
(black: #000, white: #fff),
|
|
94
|
-
_generate-palette-tokens($primary, primary),
|
|
95
|
-
_generate-palette-tokens(map.get($primary, secondary), secondary),
|
|
96
|
-
_generate-palette-tokens($tertiary, tertiary),
|
|
97
|
-
_generate-palette-tokens(map.get($primary, neutral), neutral),
|
|
98
|
-
_generate-palette-tokens(map.get($primary, neutral-variant), neutral-variant),
|
|
99
|
-
_generate-palette-tokens($error, error),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
104
|
-
/// https://github.com/material-components/material-components-web/blob/master/packages/mdc-tokens/v0_161/_md-ref-typeface.scss)
|
|
105
|
-
/// @param {List|String} $brand The font-family to use for brand text
|
|
106
|
-
/// @param {List|String} $plain The font-family to use for plain text
|
|
107
|
-
/// @param {String} $bold The font-weight to use for bold text
|
|
108
|
-
/// @param {String} $medium The font-weight to use for medium text
|
|
109
|
-
/// @param {String} $regular The font-weight to use for regular text
|
|
110
|
-
/// @return {Map} A set of `md-ref-typeface` tokens
|
|
111
|
-
@function _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular) {
|
|
112
|
-
@return (
|
|
113
|
-
brand: $brand,
|
|
114
|
-
plain: $plain,
|
|
115
|
-
weight-bold: $bold,
|
|
116
|
-
weight-medium: $medium,
|
|
117
|
-
weight-regular: $regular,
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/// At the time of writing, some color tokens (e.g. disabled state) are defined as a solid color
|
|
122
|
-
/// token and a separate opacity token. This function applies the opacity to the color and drops the
|
|
123
|
-
/// opacity key from the map. Can be removed once b/213331407 is resolved.
|
|
124
|
-
/// @param {Map} $tokens The map of tokens currently being generated
|
|
125
|
-
/// @param {Map} $all-tokens A map of all tokens, including hardcoded values
|
|
126
|
-
/// @param {List} $pairs Pairs of color token names and their opacities. Should be in the shape of
|
|
127
|
-
/// `((color: 'color-key', opacity: 'opacity-key'))`.
|
|
128
|
-
/// @return {Map} The initial tokens with the combined color values.
|
|
129
|
-
@function _combine-color-tokens($tokens, $opacity-lookup, $pairs) {
|
|
130
|
-
$result: $tokens;
|
|
131
|
-
|
|
132
|
-
@each $pair in $pairs {
|
|
133
|
-
$color-key: map.get($pair, color);
|
|
134
|
-
$opacity-key: map.get($pair, opacity);
|
|
135
|
-
$color: map.get($tokens, $color-key);
|
|
136
|
-
$opacity: map.get($opacity-lookup, $opacity-key);
|
|
137
|
-
|
|
138
|
-
@if meta.type-of($color) == 'color' {
|
|
139
|
-
@if meta.type-of($opacity) != 'number' {
|
|
140
|
-
@error 'Cannot find valid opacity value for color token "#{$color-key}"';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
$result: map.remove($result, $opacity-key);
|
|
144
|
-
$result: map.set($result, $color-key, rgba($color, $opacity));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
@return $result;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/// Generates a set of namespaced tokens for all components.
|
|
152
|
-
/// @param {Map} $systems The MDC system tokens
|
|
153
|
-
/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
|
|
154
|
-
/// @return {Map} A map of namespaced tokens
|
|
155
|
-
@function _generate-tokens($systems, $include-non-systemized: false) {
|
|
156
|
-
$systems: map.merge((
|
|
157
|
-
md-sys-color: (),
|
|
158
|
-
md-sys-elevation: (),
|
|
159
|
-
md-sys-motion: (),
|
|
160
|
-
md-sys-shape: (),
|
|
161
|
-
md-sys-state: (),
|
|
162
|
-
md-sys-typescale: ()
|
|
163
|
-
), $systems);
|
|
164
|
-
$exclude-hardcoded: not $include-non-systemized;
|
|
165
|
-
|
|
166
|
-
// DO NOT REMOVE
|
|
167
|
-
// This function is used internally.
|
|
168
|
-
$systems: format-tokens.private-format-tokens($systems);
|
|
169
|
-
|
|
170
|
-
// TODO(mmalerba): Refactor this to not depend on the legacy theme when moving out of
|
|
171
|
-
// material-experimental. This is a hack for now because there is no good way to get the token
|
|
172
|
-
// slots in material-experimental without exposing them all from material.
|
|
173
|
-
$fake-theme: mat.define-light-theme((
|
|
174
|
-
color: (
|
|
175
|
-
primary: mat.define-palette(mat.$red-palette),
|
|
176
|
-
accent: mat.define-palette(mat.$red-palette),
|
|
177
|
-
warn: mat.define-palette(mat.$red-palette),
|
|
178
|
-
),
|
|
179
|
-
typography: mat.define-typography-config(),
|
|
180
|
-
density: 0
|
|
181
|
-
));
|
|
182
|
-
$token-slots: m2.m2-tokens-from-theme($fake-theme);
|
|
183
|
-
|
|
184
|
-
// TODO(mmalerba): Fill in remaining tokens.
|
|
185
|
-
$result: mat.private-deep-merge-all(
|
|
186
|
-
_namespace-tokens(
|
|
187
|
-
(mtx, alert),
|
|
188
|
-
custom-tokens.alert($systems, $exclude-hardcoded),
|
|
189
|
-
$token-slots
|
|
190
|
-
),
|
|
191
|
-
_namespace-tokens(
|
|
192
|
-
(mtx, colorpicker),
|
|
193
|
-
custom-tokens.colorpicker($systems, $exclude-hardcoded),
|
|
194
|
-
$token-slots
|
|
195
|
-
),
|
|
196
|
-
_namespace-tokens(
|
|
197
|
-
(mtx, datetimepicker),
|
|
198
|
-
custom-tokens.datetimepicker($systems, $exclude-hardcoded),
|
|
199
|
-
$token-slots
|
|
200
|
-
),
|
|
201
|
-
_namespace-tokens(
|
|
202
|
-
(mtx, drawer),
|
|
203
|
-
custom-tokens.drawer($systems, $exclude-hardcoded),
|
|
204
|
-
$token-slots
|
|
205
|
-
),
|
|
206
|
-
_namespace-tokens(
|
|
207
|
-
(mtx, grid),
|
|
208
|
-
custom-tokens.grid($systems, $exclude-hardcoded),
|
|
209
|
-
$token-slots
|
|
210
|
-
),
|
|
211
|
-
_namespace-tokens(
|
|
212
|
-
(mtx, loader),
|
|
213
|
-
custom-tokens.loader($systems, $exclude-hardcoded),
|
|
214
|
-
$token-slots
|
|
215
|
-
),
|
|
216
|
-
_namespace-tokens(
|
|
217
|
-
(mtx, popover),
|
|
218
|
-
custom-tokens.popover($systems, $exclude-hardcoded),
|
|
219
|
-
$token-slots
|
|
220
|
-
),
|
|
221
|
-
_namespace-tokens(
|
|
222
|
-
(mtx, progress),
|
|
223
|
-
custom-tokens.progress($systems, $exclude-hardcoded),
|
|
224
|
-
$token-slots
|
|
225
|
-
),
|
|
226
|
-
_namespace-tokens(
|
|
227
|
-
(mtx, select),
|
|
228
|
-
custom-tokens.select($systems, $exclude-hardcoded),
|
|
229
|
-
$token-slots
|
|
230
|
-
),
|
|
231
|
-
_namespace-tokens(
|
|
232
|
-
(mtx, split),
|
|
233
|
-
custom-tokens.split($systems, $exclude-hardcoded),
|
|
234
|
-
$token-slots
|
|
235
|
-
),
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
// Strip out tokens that are systemized by our made up density system.
|
|
239
|
-
@each $namespace, $tokens in $result {
|
|
240
|
-
@each $token, $value in $tokens {
|
|
241
|
-
@if m3-density.is-systemized($namespace, $token) {
|
|
242
|
-
$tokens: map.remove($tokens, $token);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
$result: map.set($result, $namespace, $tokens);
|
|
246
|
-
}
|
|
247
|
-
@return $result;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/// Generates a set of namespaced color tokens for all components.
|
|
251
|
-
/// @param {String} $type The type of theme system (light or dark)
|
|
252
|
-
/// @param {Map} $primary The primary palette
|
|
253
|
-
/// @param {Map} $tertiary The tertiary palette
|
|
254
|
-
/// @param {Map} $error The error palette
|
|
255
|
-
/// @return {Map} A map of namespaced color tokens
|
|
256
|
-
@function generate-color-tokens($type, $primary, $tertiary, $error) {
|
|
257
|
-
$ref: (
|
|
258
|
-
md-ref-palette: _generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
259
|
-
);
|
|
260
|
-
$sys-color: if($type == dark,
|
|
261
|
-
mdc-tokens.md-sys-color-values-dark($ref),
|
|
262
|
-
mdc-tokens.md-sys-color-values-light($ref));
|
|
263
|
-
@return _generate-tokens(map.merge($ref, (
|
|
264
|
-
md-sys-color: $sys-color,
|
|
265
|
-
// Because the elevation values are always combined with color values to create the box shadow,
|
|
266
|
-
// elevation needs to be part of the color dimension.
|
|
267
|
-
md-sys-elevation: mdc-tokens.md-sys-elevation-values(),
|
|
268
|
-
// Because the state values are sometimes combined with color values to create rgba colors,
|
|
269
|
-
// state needs to be part of color dimension.
|
|
270
|
-
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
271
|
-
// state to the base dimension.
|
|
272
|
-
md-sys-state: mdc-tokens.md-sys-state-values(),
|
|
273
|
-
)));
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/// Generates a set of namespaced color tokens for all components.
|
|
277
|
-
/// @param {String|List} $brand The brand font-family
|
|
278
|
-
/// @param {String|List} $plain The plain fort-family
|
|
279
|
-
/// @param {String|Number} $bold The bold font-weight
|
|
280
|
-
/// @param {String|Number} $medium The medium font-weight
|
|
281
|
-
/// @param {String|Number} $regular The regular font-weight
|
|
282
|
-
/// @return {Map} A map of namespaced typography tokens
|
|
283
|
-
@function generate-typography-tokens($brand, $plain, $bold, $medium, $regular) {
|
|
284
|
-
$ref: (
|
|
285
|
-
md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
286
|
-
);
|
|
287
|
-
@return _generate-tokens((
|
|
288
|
-
md-sys-typescale: mdc-tokens.md-sys-typescale-values($ref)
|
|
289
|
-
));
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/// Generates a set of namespaced density tokens for all components.
|
|
293
|
-
/// @param {String|Number} $scale The regular font-weight
|
|
294
|
-
/// @return {Map} A map of namespaced density tokens
|
|
295
|
-
@function generate-density-tokens($scale) {
|
|
296
|
-
@return m3-density.get-tokens-for-scale($scale);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/// Generates a set of namespaced tokens not related to color, typography, or density for all
|
|
300
|
-
/// components.
|
|
301
|
-
/// @return {Map} A map of namespaced tokens not related to color, typography, or density
|
|
302
|
-
@function generate-base-tokens() {
|
|
303
|
-
// TODO(mmalerba): Exclude density tokens once implemented.
|
|
304
|
-
@return _generate-tokens((
|
|
305
|
-
md-sys-motion: mdc-tokens.md-sys-motion-values(),
|
|
306
|
-
md-sys-shape: mdc-tokens.md-sys-shape-values(),
|
|
307
|
-
), $include-non-systemized: true);
|
|
308
|
-
}
|
|
File without changes
|