@angular/material 18.0.0-next.6 → 18.0.0-rc.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/_index.scss +1 -1
- package/button/index.d.ts +1 -1
- package/core/tokens/_m3-tokens.scss +28 -885
- package/core/tokens/_token-utils.scss +151 -0
- package/core/tokens/m2/mat/_switch.scss +1 -0
- package/core/tokens/m3/_index.scss +161 -0
- package/core/tokens/m3/mat/_app.scss +19 -0
- package/core/tokens/m3/mat/_autocomplete.scss +22 -0
- package/core/tokens/m3/mat/_badge.scss +77 -0
- package/core/tokens/m3/mat/_bottom-sheet.scss +24 -0
- package/core/tokens/m3/mat/_card.scss +24 -0
- package/core/tokens/m3/mat/_checkbox.scss +21 -0
- package/core/tokens/m3/mat/_chip.scss +46 -0
- package/core/tokens/m3/mat/_datepicker.scss +123 -0
- package/core/tokens/m3/mat/_dialog.scss +30 -0
- package/core/tokens/m3/mat/_divider.scss +19 -0
- package/core/tokens/m3/mat/_expansion.scss +41 -0
- package/core/tokens/m3/mat/_fab-small.scss +50 -0
- package/core/tokens/m3/mat/_fab.scss +50 -0
- package/core/tokens/m3/mat/_filled-button.scss +54 -0
- package/core/tokens/m3/mat/_form-field.scss +59 -0
- package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +42 -0
- package/core/tokens/m3/mat/_grid-list.scss +21 -0
- package/core/tokens/m3/mat/_icon-button.scss +27 -0
- package/core/tokens/m3/mat/_icon.scss +33 -0
- package/core/tokens/m3/mat/_list.scss +19 -0
- package/core/tokens/m3/mat/_menu.scss +42 -0
- package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +33 -0
- package/core/tokens/m3/mat/_optgroup.scss +22 -0
- package/core/tokens/m3/mat/_option.scss +55 -0
- package/core/tokens/m3/mat/_outlined-button.scss +54 -0
- package/core/tokens/m3/mat/_paginator.scss +27 -0
- package/core/tokens/m3/mat/_protected-button.scss +55 -0
- package/core/tokens/m3/mat/_radio.scss +34 -0
- package/core/tokens/m3/mat/_ripple.scss +19 -0
- package/core/tokens/m3/mat/_select.scss +46 -0
- package/core/tokens/m3/mat/_sidenav.scss +28 -0
- package/core/tokens/m3/mat/_slider.scss +56 -0
- package/core/tokens/m3/mat/_snack-bar.scss +18 -0
- package/core/tokens/m3/mat/_sort.scss +18 -0
- package/core/tokens/m3/mat/_standard-button-toggle.scss +57 -0
- package/core/tokens/m3/mat/_stepper.scss +79 -0
- package/core/tokens/m3/mat/_switch.scss +45 -0
- package/core/tokens/m3/mat/_tab-header.scss +51 -0
- package/core/tokens/m3/mat/_table.scss +28 -0
- package/core/tokens/m3/mat/_text-button.scss +55 -0
- package/core/tokens/m3/mat/_toolbar.scss +23 -0
- package/core/tokens/m3/mat/_tree.scss +22 -0
- package/core/tokens/m3/mdc/_checkbox.scss +110 -0
- package/core/tokens/m3/mdc/_chip.scss +91 -0
- package/core/tokens/m3/mdc/_circular-progress.scss +29 -0
- package/core/tokens/m3/mdc/_dialog.scss +39 -0
- package/core/tokens/m3/mdc/_elevated-card.scss +15 -0
- package/core/tokens/m3/mdc/_extended-fab.scss +21 -0
- package/core/tokens/m3/mdc/_fab-small.scss +21 -0
- package/core/tokens/m3/mdc/_fab.scss +21 -0
- package/core/tokens/m3/mdc/_filled-button.scss +86 -0
- package/core/tokens/m3/mdc/_filled-text-field.scss +92 -0
- package/core/tokens/m3/mdc/_form-field.scss +25 -0
- package/core/tokens/m3/mdc/_icon-button.scss +39 -0
- package/core/tokens/m3/mdc/_linear-progress.scss +32 -0
- package/core/tokens/m3/mdc/_list.scss +37 -0
- package/core/tokens/m3/mdc/_outlined-button.scss +83 -0
- package/core/tokens/m3/mdc/_outlined-card.scss +15 -0
- package/core/tokens/m3/mdc/_outlined-text-field.scss +85 -0
- package/core/tokens/m3/mdc/_plain-tooltip.scss +15 -0
- package/core/tokens/m3/mdc/_protected-button.scss +84 -0
- package/core/tokens/m3/mdc/_radio.scss +46 -0
- package/core/tokens/m3/mdc/_slider.scss +61 -0
- package/core/tokens/m3/mdc/_snack-bar.scss +15 -0
- package/core/tokens/m3/mdc/_switch.scss +70 -0
- package/core/tokens/m3/mdc/_tab-indicator.scss +33 -0
- package/core/tokens/m3/mdc/_tab.scss +15 -0
- package/core/tokens/m3/mdc/_text-button.scss +79 -0
- package/dialog/index.d.ts +4 -3
- package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
- package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
- package/esm2022/autocomplete/autocomplete.mjs +4 -4
- package/esm2022/autocomplete/module.mjs +5 -5
- package/esm2022/badge/badge-module.mjs +5 -5
- package/esm2022/badge/badge.mjs +7 -7
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
- package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
- package/esm2022/button/button-base.mjs +7 -7
- package/esm2022/button/button.mjs +7 -7
- package/esm2022/button/fab.mjs +13 -13
- package/esm2022/button/icon-button.mjs +8 -8
- package/esm2022/button/module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle.mjs +7 -7
- package/esm2022/card/card.mjs +43 -43
- package/esm2022/card/module.mjs +5 -5
- package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
- package/esm2022/checkbox/checkbox.mjs +4 -4
- package/esm2022/checkbox/module.mjs +9 -9
- package/esm2022/chips/chip-action.mjs +4 -4
- package/esm2022/chips/chip-edit-input.mjs +4 -4
- package/esm2022/chips/chip-grid.mjs +4 -4
- package/esm2022/chips/chip-icons.mjs +10 -10
- package/esm2022/chips/chip-input.mjs +4 -4
- package/esm2022/chips/chip-listbox.mjs +4 -4
- package/esm2022/chips/chip-option.mjs +6 -6
- package/esm2022/chips/chip-row.mjs +6 -6
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +5 -5
- package/esm2022/chips/module.mjs +5 -5
- package/esm2022/core/common-behaviors/common-module.mjs +5 -5
- package/esm2022/core/datetime/index.mjs +9 -9
- package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
- package/esm2022/core/error/error-options.mjs +7 -7
- package/esm2022/core/internal-form-field/internal-form-field.mjs +4 -4
- package/esm2022/core/line/line.mjs +8 -8
- package/esm2022/core/option/index.mjs +5 -5
- package/esm2022/core/option/optgroup.mjs +4 -4
- package/esm2022/core/option/option.mjs +4 -4
- package/esm2022/core/private/ripple-loader.mjs +4 -4
- package/esm2022/core/ripple/index.mjs +5 -5
- package/esm2022/core/ripple/ripple.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +4 -4
- package/esm2022/datepicker/calendar.mjs +7 -7
- package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
- package/esm2022/datepicker/date-range-input.mjs +4 -4
- package/esm2022/datepicker/date-range-picker.mjs +4 -4
- package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
- package/esm2022/datepicker/date-selection-model.mjs +10 -10
- package/esm2022/datepicker/datepicker-actions.mjs +10 -10
- package/esm2022/datepicker/datepicker-base.mjs +7 -7
- package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
- package/esm2022/datepicker/datepicker-input.mjs +4 -4
- package/esm2022/datepicker/datepicker-intl.mjs +4 -4
- package/esm2022/datepicker/datepicker-module.mjs +5 -5
- package/esm2022/datepicker/datepicker-toggle.mjs +7 -7
- package/esm2022/datepicker/datepicker.mjs +4 -4
- package/esm2022/datepicker/month-view.mjs +4 -4
- package/esm2022/datepicker/multi-year-view.mjs +4 -4
- package/esm2022/datepicker/year-view.mjs +4 -4
- package/esm2022/dialog/dialog-container.mjs +4 -4
- package/esm2022/dialog/dialog-content-directives.mjs +19 -16
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/dialog/module.mjs +5 -5
- package/esm2022/divider/divider-module.mjs +5 -5
- package/esm2022/divider/divider.mjs +4 -4
- package/esm2022/expansion/accordion.mjs +4 -4
- package/esm2022/expansion/expansion-module.mjs +5 -5
- package/esm2022/expansion/expansion-panel-content.mjs +4 -4
- package/esm2022/expansion/expansion-panel-header.mjs +10 -10
- package/esm2022/expansion/expansion-panel.mjs +7 -7
- package/esm2022/form-field/directives/error.mjs +4 -4
- package/esm2022/form-field/directives/floating-label.mjs +4 -4
- package/esm2022/form-field/directives/hint.mjs +4 -4
- package/esm2022/form-field/directives/label.mjs +4 -4
- package/esm2022/form-field/directives/line-ripple.mjs +4 -4
- package/esm2022/form-field/directives/notched-outline.mjs +4 -4
- package/esm2022/form-field/directives/prefix.mjs +4 -4
- package/esm2022/form-field/directives/suffix.mjs +4 -4
- package/esm2022/form-field/form-field-control.mjs +4 -4
- package/esm2022/form-field/form-field.mjs +4 -4
- package/esm2022/form-field/module.mjs +5 -5
- package/esm2022/grid-list/grid-list-module.mjs +5 -5
- package/esm2022/grid-list/grid-list.mjs +4 -4
- package/esm2022/grid-list/grid-tile.mjs +16 -16
- package/esm2022/icon/icon-module.mjs +5 -5
- package/esm2022/icon/icon-registry.mjs +4 -4
- package/esm2022/icon/icon.mjs +4 -4
- package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
- package/esm2022/input/input.mjs +4 -4
- package/esm2022/input/module.mjs +5 -5
- package/esm2022/list/action-list.mjs +4 -4
- package/esm2022/list/list-base.mjs +7 -7
- package/esm2022/list/list-item-sections.mjs +19 -19
- package/esm2022/list/list-module.mjs +5 -5
- package/esm2022/list/list-option.mjs +4 -4
- package/esm2022/list/list.mjs +7 -7
- package/esm2022/list/nav-list.mjs +4 -4
- package/esm2022/list/selection-list.mjs +4 -4
- package/esm2022/list/subheader.mjs +4 -4
- package/esm2022/menu/menu-content.mjs +4 -4
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu-trigger.mjs +4 -4
- package/esm2022/menu/menu.mjs +4 -4
- package/esm2022/menu/module.mjs +5 -5
- package/esm2022/paginator/module.mjs +5 -5
- package/esm2022/paginator/paginator-intl.mjs +4 -4
- package/esm2022/paginator/paginator.mjs +4 -4
- package/esm2022/progress-bar/module.mjs +5 -5
- package/esm2022/progress-bar/progress-bar.mjs +4 -4
- package/esm2022/progress-spinner/module.mjs +5 -5
- package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
- package/esm2022/radio/module.mjs +5 -5
- package/esm2022/radio/radio.mjs +7 -7
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +7 -7
- package/esm2022/sidenav/drawer.mjs +10 -10
- package/esm2022/sidenav/sidenav-module.mjs +5 -5
- package/esm2022/sidenav/sidenav.mjs +10 -10
- package/esm2022/slide-toggle/module.mjs +9 -9
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
- package/esm2022/slide-toggle/slide-toggle.mjs +6 -6
- package/esm2022/slider/module.mjs +5 -5
- package/esm2022/slider/slider-input.mjs +7 -7
- package/esm2022/slider/slider-thumb.mjs +4 -4
- package/esm2022/slider/slider.mjs +4 -4
- package/esm2022/snack-bar/module.mjs +5 -5
- package/esm2022/snack-bar/simple-snack-bar.mjs +4 -4
- package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
- package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
- package/esm2022/snack-bar/snack-bar.mjs +4 -4
- package/esm2022/sort/sort-header-intl.mjs +4 -4
- package/esm2022/sort/sort-header.mjs +4 -4
- package/esm2022/sort/sort-module.mjs +5 -5
- package/esm2022/sort/sort.mjs +4 -4
- package/esm2022/stepper/step-content.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +4 -4
- package/esm2022/stepper/step-label.mjs +4 -4
- package/esm2022/stepper/stepper-button.mjs +7 -7
- package/esm2022/stepper/stepper-icon.mjs +4 -4
- package/esm2022/stepper/stepper-intl.mjs +4 -4
- package/esm2022/stepper/stepper-module.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +7 -7
- package/esm2022/table/cell.mjs +22 -22
- package/esm2022/table/module.mjs +5 -5
- package/esm2022/table/row.mjs +22 -22
- package/esm2022/table/table.mjs +7 -7
- package/esm2022/table/text-column.mjs +4 -4
- package/esm2022/tabs/ink-bar.mjs +4 -4
- package/esm2022/tabs/module.mjs +5 -5
- package/esm2022/tabs/paginated-tab-header.mjs +4 -4
- package/esm2022/tabs/tab-body.mjs +7 -7
- package/esm2022/tabs/tab-content.mjs +4 -4
- package/esm2022/tabs/tab-group.mjs +4 -4
- package/esm2022/tabs/tab-header.mjs +4 -4
- package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
- package/esm2022/tabs/tab-label.mjs +4 -4
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
- package/esm2022/tabs/tab.mjs +4 -4
- package/esm2022/toolbar/toolbar-module.mjs +5 -5
- package/esm2022/toolbar/toolbar.mjs +7 -7
- package/esm2022/tooltip/module.mjs +5 -5
- package/esm2022/tooltip/tooltip.mjs +11 -8
- package/esm2022/tree/node.mjs +10 -10
- package/esm2022/tree/outlet.mjs +4 -4
- package/esm2022/tree/padding.mjs +4 -4
- package/esm2022/tree/toggle.mjs +4 -4
- package/esm2022/tree/tree-module.mjs +5 -5
- package/esm2022/tree/tree.mjs +4 -4
- package/fesm2022/autocomplete.mjs +13 -13
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +10 -10
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +10 -10
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +35 -35
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +14 -14
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +45 -45
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +59 -59
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +82 -82
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +28 -25
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +7 -7
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +25 -25
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +34 -34
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list.mjs +49 -49
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +16 -16
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +10 -10
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +7 -7
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +7 -7
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +10 -10
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +10 -10
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +22 -22
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +16 -16
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +16 -16
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +22 -22
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +13 -13
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +31 -31
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +43 -43
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +10 -10
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +14 -11
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- 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/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/m3-theme/index_bundled.js +4 -3
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +2 -2
- package/schematics/ng-generate/m3-theme/schema.json +3 -20
- package/core/tokens/_custom-tokens.scss +0 -1918
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
|
|
6
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
7
|
+
$prefix: (mdc, filled-text-field);
|
|
8
|
+
|
|
9
|
+
/// Generates the tokens for MDC filled-text-field
|
|
10
|
+
/// @param {Map} $systems The MDC system tokens
|
|
11
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
12
|
+
/// @param {Map} $token-slots Possible token slots
|
|
13
|
+
/// @return {Map} A set of tokens for the MDC filled-text-field
|
|
14
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
15
|
+
$mdc-tokens: token-utils.get-mdc-tokens('filled-text-field', $systems, $exclude-hardcoded);
|
|
16
|
+
$variant-tokens: (
|
|
17
|
+
primary: (), // Default, no overrides needed
|
|
18
|
+
secondary: (
|
|
19
|
+
caret-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
focus-active-indicator-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
focus-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
22
|
+
),
|
|
23
|
+
tertiary: (
|
|
24
|
+
caret-color: map.get($systems, md-sys-color, tertiary),
|
|
25
|
+
focus-active-indicator-color: map.get($systems, md-sys-color, tertiary),
|
|
26
|
+
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
27
|
+
),
|
|
28
|
+
error: (
|
|
29
|
+
caret-color: map.get($systems, md-sys-color, error),
|
|
30
|
+
focus-active-indicator-color: map.get($systems, md-sys-color, error),
|
|
31
|
+
focus-label-text-color: map.get($systems, md-sys-color, error),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
@return token-utils.namespace-tokens($prefix, (
|
|
36
|
+
_fix-tokens($mdc-tokens),
|
|
37
|
+
token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
|
|
38
|
+
), $token-slots);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/// Fixes inconsistent values in the filled text field tokens so that they can produce valid
|
|
43
|
+
/// styles.
|
|
44
|
+
/// @param {Map} $initial-tokens Map of filled text field tokens currently being generated.
|
|
45
|
+
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
|
|
46
|
+
@function _fix-tokens($initial-tokens) {
|
|
47
|
+
// Need to get the hardcoded values, because they include opacities that are used for the disabled
|
|
48
|
+
// state.
|
|
49
|
+
$hardcoded-tokens: token-utils.get-mdc-tokens('filled-text-field', (), false);
|
|
50
|
+
|
|
51
|
+
$tokens: token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
|
|
52
|
+
(
|
|
53
|
+
color: disabled-active-indicator-color,
|
|
54
|
+
opacity: disabled-active-indicator-opacity
|
|
55
|
+
),
|
|
56
|
+
(
|
|
57
|
+
color: disabled-container-color,
|
|
58
|
+
opacity: disabled-container-opacity
|
|
59
|
+
),
|
|
60
|
+
(
|
|
61
|
+
color: disabled-input-text-color,
|
|
62
|
+
opacity: disabled-input-text-opacity
|
|
63
|
+
),
|
|
64
|
+
(
|
|
65
|
+
color: disabled-label-text-color,
|
|
66
|
+
opacity: disabled-label-text-opacity
|
|
67
|
+
),
|
|
68
|
+
(
|
|
69
|
+
color: disabled-leading-icon-color,
|
|
70
|
+
opacity: disabled-leading-icon-opacity
|
|
71
|
+
),
|
|
72
|
+
(
|
|
73
|
+
color: disabled-supporting-text-color,
|
|
74
|
+
opacity: disabled-supporting-text-opacity
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
color: disabled-trailing-icon-color,
|
|
78
|
+
opacity: disabled-trailing-icon-opacity
|
|
79
|
+
)
|
|
80
|
+
));
|
|
81
|
+
|
|
82
|
+
$container-shape: map.get($tokens, container-shape);
|
|
83
|
+
|
|
84
|
+
// The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
|
|
85
|
+
// of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
|
|
86
|
+
// token slot in M2.
|
|
87
|
+
@if meta.type-of($container-shape) == 'list' {
|
|
88
|
+
$tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@return $tokens;
|
|
92
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mdc, form-field);
|
|
6
|
+
|
|
7
|
+
/// Generates the tokens for MDC form-field
|
|
8
|
+
/// @param {Map} $systems The MDC system tokens
|
|
9
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
10
|
+
/// @param {Map} $token-slots Possible token slots
|
|
11
|
+
/// @return {Map} A set of tokens for the MDC form-field
|
|
12
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
13
|
+
$tokens: (
|
|
14
|
+
// TODO: MDC currently doesn't provide tokens for the form field so we need to
|
|
15
|
+
// define them ourselves. Clean this up once b/246297033 is resolved.
|
|
16
|
+
label-text-color: map.get($systems, md-sys-color, on-surface),
|
|
17
|
+
label-text-font: map.get($systems, md-sys-typescale, body-medium-font),
|
|
18
|
+
label-text-line-height: map.get($systems, md-sys-typescale, body-medium-line-height),
|
|
19
|
+
label-text-size: map.get($systems, md-sys-typescale, body-medium-size),
|
|
20
|
+
label-text-tracking: map.get($systems, md-sys-typescale, body-medium-tracking),
|
|
21
|
+
label-text-weight: map.get($systems, md-sys-typescale, body-medium-weight),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
@return token-utils.namespace-tokens($prefix, $tokens, $token-slots);
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
|
|
3
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
4
|
+
$prefix: (mdc, icon-button);
|
|
5
|
+
|
|
6
|
+
/// Generates the tokens for MDC icon-button
|
|
7
|
+
/// @param {Map} $systems The MDC system tokens
|
|
8
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
9
|
+
/// @param {Map} $token-slots Possible token slots
|
|
10
|
+
/// @return {Map} A set of tokens for the MDC icon-button
|
|
11
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
12
|
+
$mdc-tokens: token-utils.get-mdc-tokens('icon-button', $systems, $exclude-hardcoded);
|
|
13
|
+
|
|
14
|
+
@return token-utils.namespace-tokens($prefix, _fix-tokens($mdc-tokens), $token-slots);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/// Fixes inconsistent values in the icon button tokens so that they can produce valid styles.
|
|
18
|
+
/// @param {Map} $initial-tokens Map of icon button tokens currently being generated.
|
|
19
|
+
/// @param {Map} $all-tokens Map of all icon button tokens, including hardcoded values.
|
|
20
|
+
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
|
|
21
|
+
@function _fix-tokens($tokens) {
|
|
22
|
+
// Need to get the hardcoded values, because they include opacities that are used for the disabled
|
|
23
|
+
// state.
|
|
24
|
+
$hardcoded-tokens: token-utils.get-mdc-tokens('icon-button', (), false);
|
|
25
|
+
|
|
26
|
+
$rename-keys: (
|
|
27
|
+
unselected-icon-color: icon-color,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
$remapped-tokens: token-utils.rename-map-keys($tokens, $rename-keys);
|
|
31
|
+
$remapped-hardcoded-tokens: token-utils.rename-map-keys($hardcoded-tokens, $rename-keys);
|
|
32
|
+
|
|
33
|
+
@return token-utils.combine-color-tokens($remapped-tokens, $remapped-hardcoded-tokens, (
|
|
34
|
+
(
|
|
35
|
+
color: disabled-icon-color,
|
|
36
|
+
opacity: disabled-icon-opacity,
|
|
37
|
+
),
|
|
38
|
+
));
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mdc, linear-progress);
|
|
6
|
+
|
|
7
|
+
/// Generates the tokens for MDC linear-progress
|
|
8
|
+
/// @param {Map} $systems The MDC system tokens
|
|
9
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
10
|
+
/// @param {Map} $token-slots Possible token slots
|
|
11
|
+
/// @return {Map} A set of tokens for the MDC linear-progress
|
|
12
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
13
|
+
$mdc-tokens:
|
|
14
|
+
token-utils.get-mdc-tokens('linear-progress-indicator', $systems, $exclude-hardcoded);
|
|
15
|
+
$variant-tokens: (
|
|
16
|
+
primary: (), // Default, no overrides needed
|
|
17
|
+
secondary: (
|
|
18
|
+
active-indicator-color: map.get($systems, md-sys-color, secondary),
|
|
19
|
+
track-color: map.get($systems, md-sys-color, secondary-container),
|
|
20
|
+
),
|
|
21
|
+
tertiary: (
|
|
22
|
+
active-indicator-color: map.get($systems, md-sys-color, tertiary),
|
|
23
|
+
track-color: map.get($systems, md-sys-color, tertiary-container),
|
|
24
|
+
),
|
|
25
|
+
error: (
|
|
26
|
+
active-indicator-color: map.get($systems, md-sys-color, error),
|
|
27
|
+
track-color: map.get($systems, md-sys-color, error-container),
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
@return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mdc, list);
|
|
6
|
+
|
|
7
|
+
/// Generates the tokens for MDC list
|
|
8
|
+
/// @param {Map} $systems The MDC system tokens
|
|
9
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
10
|
+
/// @param {Map} $token-slots Possible token slots
|
|
11
|
+
/// @return {Map} A set of tokens for the MDC list
|
|
12
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
13
|
+
$mdc-tokens: token-utils.get-mdc-tokens('list', $systems, $exclude-hardcoded);
|
|
14
|
+
|
|
15
|
+
@return token-utils.namespace-tokens($prefix, _fix-tokens($mdc-tokens), $token-slots);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// Fixes values in the list tokens that are inconsistent with its usage.
|
|
19
|
+
/// @param {Map} $initial-tokens Map of list tokens currently being generated.
|
|
20
|
+
/// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
|
|
21
|
+
@function _fix-tokens($tokens) {
|
|
22
|
+
// This does not match the spec, which defines this to be `md.sys.color.surface`.
|
|
23
|
+
// However, this interferes with the use case of placing a list on other components. For example,
|
|
24
|
+
// the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
|
|
25
|
+
// list to just display the colors for its background.
|
|
26
|
+
@if map.get($tokens, list-item-container-color) != null {
|
|
27
|
+
$tokens: map.set($tokens, list-item-container-color, transparent);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Match spec, which has list-item-leading-icon-size of 24px.
|
|
31
|
+
// Current version of tokens (0_161) has 18px.
|
|
32
|
+
@if map.get($tokens, list-item-leading-icon-size) != null {
|
|
33
|
+
$tokens: map.set($tokens, list-item-leading-icon-size, 24px);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@return $tokens;
|
|
37
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
|
|
5
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
|
+
$prefix: (mdc, outlined-button);
|
|
7
|
+
|
|
8
|
+
/// Generates the tokens for MDC outlined-button
|
|
9
|
+
/// @param {Map} $systems The MDC system tokens
|
|
10
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
11
|
+
/// @param {Map} $token-slots Possible token slots
|
|
12
|
+
/// @return {Map} A set of tokens for the MDC outlined-button
|
|
13
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
14
|
+
$mdc-tokens: token-utils.get-mdc-tokens('outlined-button', $systems, $exclude-hardcoded);
|
|
15
|
+
$variant-tokens: (
|
|
16
|
+
primary: (), // Default, no overrides needed.
|
|
17
|
+
secondary: (
|
|
18
|
+
focus-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
19
|
+
focus-outline-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
hover-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
22
|
+
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
23
|
+
label-text-color: map.get($systems, md-sys-color, secondary),
|
|
24
|
+
pressed-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
25
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
26
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
|
|
27
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
|
|
28
|
+
with-icon-icon-color: map.get($systems, md-sys-color, secondary),
|
|
29
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
|
|
30
|
+
),
|
|
31
|
+
tertiary: (
|
|
32
|
+
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
33
|
+
focus-outline-color: map.get($systems, md-sys-color, tertiary),
|
|
34
|
+
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
35
|
+
hover-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
36
|
+
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
37
|
+
label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
38
|
+
pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
39
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
40
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
41
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
42
|
+
with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
43
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
|
|
44
|
+
),
|
|
45
|
+
error: (
|
|
46
|
+
focus-label-text-color: map.get($systems, md-sys-color, error),
|
|
47
|
+
focus-outline-color: map.get($systems, md-sys-color, error),
|
|
48
|
+
focus-state-layer-color: map.get($systems, md-sys-color, error),
|
|
49
|
+
hover-label-text-color: map.get($systems, md-sys-color, error),
|
|
50
|
+
hover-state-layer-color: map.get($systems, md-sys-color, error),
|
|
51
|
+
label-text-color: map.get($systems, md-sys-color, error),
|
|
52
|
+
pressed-label-text-color: map.get($systems, md-sys-color, error),
|
|
53
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, error),
|
|
54
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
|
|
55
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
|
|
56
|
+
with-icon-icon-color: map.get($systems, md-sys-color, error),
|
|
57
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
@return token-utils.namespace-tokens($prefix, (
|
|
62
|
+
_fix-tokens($mdc-tokens),
|
|
63
|
+
token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
|
|
64
|
+
), $token-slots);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Fixes inconsistent values in the outlined button tokens so that they can produce valid styles.
|
|
68
|
+
/// @param {Map} $initial-tokens Map of outlined button tokens currently being generated.
|
|
69
|
+
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
|
|
70
|
+
@function _fix-tokens($initial-tokens) {
|
|
71
|
+
$hardcoded-tokens: token-utils.get-mdc-tokens('outlined-button', (), false);
|
|
72
|
+
|
|
73
|
+
@return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
|
|
74
|
+
(
|
|
75
|
+
color: disabled-label-text-color,
|
|
76
|
+
opacity: disabled-label-text-opacity,
|
|
77
|
+
),
|
|
78
|
+
(
|
|
79
|
+
color: disabled-outline-color,
|
|
80
|
+
opacity: disabled-outline-opacity,
|
|
81
|
+
)
|
|
82
|
+
));
|
|
83
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
|
|
3
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
4
|
+
$prefix: (mdc, outlined-card);
|
|
5
|
+
|
|
6
|
+
/// Generates the tokens for MDC outlined-card
|
|
7
|
+
/// @param {Map} $systems The MDC system tokens
|
|
8
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
9
|
+
/// @param {Map} $token-slots Possible token slots
|
|
10
|
+
/// @return {Map} A set of tokens for the MDC outlined-card
|
|
11
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
12
|
+
$mdc-tokens: token-utils.get-mdc-tokens('outlined-card', $systems, $exclude-hardcoded);
|
|
13
|
+
|
|
14
|
+
@return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
|
|
5
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
|
+
$prefix: (mdc, outlined-text-field);
|
|
7
|
+
|
|
8
|
+
/// Generates the tokens for MDC outlined-text-field
|
|
9
|
+
/// @param {Map} $systems The MDC system tokens
|
|
10
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
11
|
+
/// @param {Map} $token-slots Possible token slots
|
|
12
|
+
/// @return {Map} A set of tokens for the MDC outlined-text-field
|
|
13
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
14
|
+
$mdc-tokens: token-utils.get-mdc-tokens('outlined-text-field', $systems, $exclude-hardcoded);
|
|
15
|
+
$variant-tokens: (
|
|
16
|
+
primary: (), // Default, no overrides needed
|
|
17
|
+
secondary: (
|
|
18
|
+
caret-color: map.get($systems, md-sys-color, secondary),
|
|
19
|
+
focus-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
focus-outline-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
),
|
|
22
|
+
tertiary: (
|
|
23
|
+
caret-color: map.get($systems, md-sys-color, tertiary),
|
|
24
|
+
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
25
|
+
focus-outline-color: map.get($systems, md-sys-color, tertiary),
|
|
26
|
+
),
|
|
27
|
+
error: (
|
|
28
|
+
caret-color: map.get($systems, md-sys-color, error),
|
|
29
|
+
focus-label-text-color: map.get($systems, md-sys-color, error),
|
|
30
|
+
focus-outline-color: map.get($systems, md-sys-color, error),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
@return token-utils.namespace-tokens($prefix, (
|
|
35
|
+
_fix-tokens($mdc-tokens),
|
|
36
|
+
token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens))
|
|
37
|
+
), $token-slots);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Fixes inconsistent values in the outlined text field tokens so that they can produce valid
|
|
41
|
+
/// styles.
|
|
42
|
+
/// @param {Map} $initial-tokens Map of outlined text field tokens currently being generated.
|
|
43
|
+
/// @param {Map} $all-tokens Map of all outlined text field tokens, including hardcoded values.
|
|
44
|
+
/// This is necessary in order to do opacity lookups.
|
|
45
|
+
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
|
|
46
|
+
@function _fix-tokens($initial-tokens) {
|
|
47
|
+
// Need to get the hardcoded values, because they include opacities that are used for the disabled
|
|
48
|
+
// state.
|
|
49
|
+
$hardcoded-tokens: token-utils.get-mdc-tokens('outlined-text-field', (), false);
|
|
50
|
+
|
|
51
|
+
@return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
|
|
52
|
+
(
|
|
53
|
+
color: disabled-outline-color,
|
|
54
|
+
opacity: disabled-outline-opacity
|
|
55
|
+
),
|
|
56
|
+
(
|
|
57
|
+
color: disabled-active-indicator-color,
|
|
58
|
+
opacity: disabled-active-indicator-opacity
|
|
59
|
+
),
|
|
60
|
+
(
|
|
61
|
+
color: disabled-container-color,
|
|
62
|
+
opacity: disabled-container-opacity
|
|
63
|
+
),
|
|
64
|
+
(
|
|
65
|
+
color: disabled-input-text-color,
|
|
66
|
+
opacity: disabled-input-text-opacity
|
|
67
|
+
),
|
|
68
|
+
(
|
|
69
|
+
color: disabled-label-text-color,
|
|
70
|
+
opacity: disabled-label-text-opacity
|
|
71
|
+
),
|
|
72
|
+
(
|
|
73
|
+
color: disabled-leading-icon-color,
|
|
74
|
+
opacity: disabled-leading-icon-opacity
|
|
75
|
+
),
|
|
76
|
+
(
|
|
77
|
+
color: disabled-supporting-text-color,
|
|
78
|
+
opacity: disabled-supporting-text-opacity
|
|
79
|
+
),
|
|
80
|
+
(
|
|
81
|
+
color: disabled-trailing-icon-color,
|
|
82
|
+
opacity: disabled-trailing-icon-opacity
|
|
83
|
+
)
|
|
84
|
+
));
|
|
85
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
|
|
3
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
4
|
+
$prefix: (mdc, plain-tooltip);
|
|
5
|
+
|
|
6
|
+
/// Generates the tokens for MDC plain-tooltip
|
|
7
|
+
/// @param {Map} $systems The MDC system tokens
|
|
8
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
9
|
+
/// @param {Map} $token-slots Possible token slots
|
|
10
|
+
/// @return {Map} A set of tokens for the MDC plain-tooltip
|
|
11
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
12
|
+
$mdc-tokens: token-utils.get-mdc-tokens('plain-tooltip', $systems, $exclude-hardcoded);
|
|
13
|
+
|
|
14
|
+
@return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
|
|
15
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
|
|
5
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
6
|
+
$prefix: (mdc, protected-button);
|
|
7
|
+
|
|
8
|
+
/// Generates the tokens for MDC protected-button
|
|
9
|
+
/// @param {Map} $systems The MDC system tokens
|
|
10
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
11
|
+
/// @param {Map} $token-slots Possible token slots
|
|
12
|
+
/// @return {Map} A set of tokens for the MDC protected-button
|
|
13
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
14
|
+
// Note: in M3 the "protected" button is called "elevated".
|
|
15
|
+
$mdc-tokens: token-utils.get-mdc-tokens('elevated-button', $systems, $exclude-hardcoded);
|
|
16
|
+
$variant-tokens: (
|
|
17
|
+
primary: (), // Default, no overrides needed.
|
|
18
|
+
secondary: (
|
|
19
|
+
focus-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
hover-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
22
|
+
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
23
|
+
label-text-color: map.get($systems, md-sys-color, secondary),
|
|
24
|
+
pressed-label-text-color: map.get($systems, md-sys-color, secondary),
|
|
25
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
26
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
|
|
27
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
|
|
28
|
+
with-icon-icon-color: map.get($systems, md-sys-color, secondary),
|
|
29
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
|
|
30
|
+
),
|
|
31
|
+
tertiary: (
|
|
32
|
+
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
33
|
+
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
34
|
+
hover-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
35
|
+
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
36
|
+
label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
37
|
+
pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
|
|
38
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
39
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
40
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
41
|
+
with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
42
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
|
|
43
|
+
),
|
|
44
|
+
error: (
|
|
45
|
+
focus-label-text-color: map.get($systems, md-sys-color, error),
|
|
46
|
+
focus-state-layer-color: map.get($systems, md-sys-color, error),
|
|
47
|
+
hover-label-text-color: map.get($systems, md-sys-color, error),
|
|
48
|
+
hover-state-layer-color: map.get($systems, md-sys-color, error),
|
|
49
|
+
label-text-color: map.get($systems, md-sys-color, error),
|
|
50
|
+
pressed-label-text-color: map.get($systems, md-sys-color, error),
|
|
51
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, error),
|
|
52
|
+
with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
|
|
53
|
+
with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
|
|
54
|
+
with-icon-icon-color: map.get($systems, md-sys-color, error),
|
|
55
|
+
with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
@return token-utils.namespace-tokens($prefix, (
|
|
60
|
+
_fix-tokens($mdc-tokens),
|
|
61
|
+
token-utils.map-values($variant-tokens, meta.get-function(_fix-tokens)),
|
|
62
|
+
), $token-slots);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/// Fixes inconsistent values in the protected button tokens so that they can produce valid styles.
|
|
67
|
+
/// @param {Map} $initial-tokens Map of protected button tokens currently being generated.
|
|
68
|
+
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
|
|
69
|
+
@function _fix-tokens($initial-tokens) {
|
|
70
|
+
// Need to get the hardcoded values, because they include opacities that are used for the disabled
|
|
71
|
+
// state.
|
|
72
|
+
$hardcoded-tokens: token-utils.get-mdc-tokens('elevated-button', (), false);
|
|
73
|
+
|
|
74
|
+
@return token-utils.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
|
|
75
|
+
(
|
|
76
|
+
color: disabled-label-text-color,
|
|
77
|
+
opacity: disabled-label-text-opacity,
|
|
78
|
+
),
|
|
79
|
+
(
|
|
80
|
+
color: disabled-container-color,
|
|
81
|
+
opacity: disabled-container-opacity,
|
|
82
|
+
)
|
|
83
|
+
));
|
|
84
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mdc, radio);
|
|
6
|
+
|
|
7
|
+
/// Generates the tokens for MDC radio
|
|
8
|
+
/// @param {Map} $systems The MDC system tokens
|
|
9
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
10
|
+
/// @param {Map} $token-slots Possible token slots
|
|
11
|
+
/// @return {Map} A set of tokens for the MDC radio
|
|
12
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
13
|
+
$mdc-tokens: token-utils.get-mdc-tokens('radio-button', $systems, $exclude-hardcoded);
|
|
14
|
+
$variant-tokens: (
|
|
15
|
+
primary: (), // Default, no overrides needed
|
|
16
|
+
secondary: (
|
|
17
|
+
selected-focus-icon-color: map.get($systems, md-sys-color, secondary),
|
|
18
|
+
selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
19
|
+
selected-hover-icon-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
selected-icon-color: map.get($systems, md-sys-color, secondary),
|
|
22
|
+
selected-pressed-icon-color: map.get($systems, md-sys-color, secondary),
|
|
23
|
+
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
24
|
+
),
|
|
25
|
+
tertiary: (
|
|
26
|
+
selected-focus-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
27
|
+
selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
28
|
+
selected-hover-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
29
|
+
selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
30
|
+
selected-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
31
|
+
selected-pressed-icon-color: map.get($systems, md-sys-color, tertiary),
|
|
32
|
+
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
33
|
+
),
|
|
34
|
+
error: (
|
|
35
|
+
selected-focus-icon-color: map.get($systems, md-sys-color, error),
|
|
36
|
+
selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
|
|
37
|
+
selected-hover-icon-color: map.get($systems, md-sys-color, error),
|
|
38
|
+
selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
|
|
39
|
+
selected-icon-color: map.get($systems, md-sys-color, error),
|
|
40
|
+
selected-pressed-icon-color: map.get($systems, md-sys-color, error),
|
|
41
|
+
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
@return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
|
|
46
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../token-utils';
|
|
3
|
+
|
|
4
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
5
|
+
$prefix: (mdc, slider);
|
|
6
|
+
|
|
7
|
+
/// Generates the tokens for MDC slider
|
|
8
|
+
/// @param {Map} $systems The MDC system tokens
|
|
9
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
10
|
+
/// @param {Map} $token-slots Possible token slots
|
|
11
|
+
/// @return {Map} A set of tokens for the MDC slider
|
|
12
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
13
|
+
$mdc-tokens: token-utils.get-mdc-tokens('slider', $systems, $exclude-hardcoded);
|
|
14
|
+
$variant-tokens: (
|
|
15
|
+
primary: (), // Default, no overrides needed
|
|
16
|
+
secondary: (
|
|
17
|
+
active-track-color: map.get($systems, md-sys-color, secondary),
|
|
18
|
+
focus-handle-color: map.get($systems, md-sys-color, secondary),
|
|
19
|
+
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
20
|
+
handle-color: map.get($systems, md-sys-color, secondary),
|
|
21
|
+
hover-handle-color: map.get($systems, md-sys-color, secondary),
|
|
22
|
+
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
23
|
+
label-container-color: map.get($systems, md-sys-color, secondary),
|
|
24
|
+
label-label-text-color: map.get($systems, md-sys-color, on-secondary),
|
|
25
|
+
pressed-handle-color: map.get($systems, md-sys-color, secondary),
|
|
26
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
|
|
27
|
+
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-secondary),
|
|
28
|
+
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-secondary),
|
|
29
|
+
),
|
|
30
|
+
tertiary: (
|
|
31
|
+
active-track-color: map.get($systems, md-sys-color, tertiary),
|
|
32
|
+
focus-handle-color: map.get($systems, md-sys-color, tertiary),
|
|
33
|
+
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
34
|
+
handle-color: map.get($systems, md-sys-color, tertiary),
|
|
35
|
+
hover-handle-color: map.get($systems, md-sys-color, tertiary),
|
|
36
|
+
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
37
|
+
label-container-color: map.get($systems, md-sys-color, tertiary),
|
|
38
|
+
label-label-text-color: map.get($systems, md-sys-color, on-tertiary),
|
|
39
|
+
pressed-handle-color: map.get($systems, md-sys-color, tertiary),
|
|
40
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
|
|
41
|
+
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-tertiary),
|
|
42
|
+
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-tertiary),
|
|
43
|
+
),
|
|
44
|
+
error: (
|
|
45
|
+
active-track-color: map.get($systems, md-sys-color, error),
|
|
46
|
+
focus-handle-color: map.get($systems, md-sys-color, error),
|
|
47
|
+
focus-state-layer-color: map.get($systems, md-sys-color, error),
|
|
48
|
+
handle-color: map.get($systems, md-sys-color, error),
|
|
49
|
+
hover-handle-color: map.get($systems, md-sys-color, error),
|
|
50
|
+
hover-state-layer-color: map.get($systems, md-sys-color, error),
|
|
51
|
+
label-container-color: map.get($systems, md-sys-color, error),
|
|
52
|
+
label-label-text-color: map.get($systems, md-sys-color, on-error),
|
|
53
|
+
pressed-handle-color: map.get($systems, md-sys-color, error),
|
|
54
|
+
pressed-state-layer-color: map.get($systems, md-sys-color, error),
|
|
55
|
+
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-error),
|
|
56
|
+
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-error),
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
@return token-utils.namespace-tokens($prefix, ($mdc-tokens, $variant-tokens), $token-slots);
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use '../../token-utils';
|
|
2
|
+
|
|
3
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
4
|
+
$prefix: (mdc, snackbar);
|
|
5
|
+
|
|
6
|
+
/// Generates the tokens for MDC snackbar
|
|
7
|
+
/// @param {Map} $systems The MDC system tokens
|
|
8
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
9
|
+
/// @param {Map} $token-slots Possible token slots
|
|
10
|
+
/// @return {Map} A set of tokens for the MDC snackbar
|
|
11
|
+
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
|
|
12
|
+
$mdc-tokens: token-utils.get-mdc-tokens('snackbar', $systems, $exclude-hardcoded);
|
|
13
|
+
|
|
14
|
+
@return token-utils.namespace-tokens($prefix, $mdc-tokens, $token-slots);
|
|
15
|
+
}
|