@angular/material 18.2.0-next.1 → 18.2.0-next.3
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 +3 -1
- package/button/_button-base.scss +5 -11
- package/checkbox/_checkbox-common.scss +47 -15
- package/checkbox/index.d.ts +6 -1
- package/chips/index.d.ts +3 -8
- package/core/_core.scss +15 -18
- package/core/m2/_typography.scss +129 -2
- package/core/ripple/_ripple.scss +1 -1
- package/core/style/_elevation.scss +121 -27
- package/core/style/_sass-utils.scss +20 -2
- package/core/theming/_definition.scss +2 -0
- package/core/tokens/_m3-tokens.scss +118 -22
- package/core/tokens/_token-definition.scss +272 -0
- package/core/tokens/_token-utils.scss +68 -239
- package/core/tokens/m2/mat/_app.scss +4 -4
- package/core/tokens/m2/mat/_autocomplete.scss +4 -4
- package/core/tokens/m2/mat/_badge.scss +4 -4
- package/core/tokens/m2/mat/_bottom-sheet.scss +4 -4
- package/core/tokens/m2/mat/_card.scss +4 -4
- package/core/tokens/m2/mat/_checkbox.scss +4 -4
- package/core/tokens/m2/mat/_chip.scss +4 -4
- package/core/tokens/m2/mat/_datepicker.scss +4 -4
- package/core/tokens/m2/mat/_dialog.scss +4 -4
- package/core/tokens/m2/mat/_divider.scss +4 -4
- package/core/tokens/m2/mat/_expansion.scss +4 -4
- package/core/tokens/m2/mat/_fab-small.scss +7 -7
- package/core/tokens/m2/mat/_fab.scss +7 -7
- package/core/tokens/m2/mat/_filled-button.scss +7 -7
- package/core/tokens/m2/mat/_form-field.scss +4 -6
- package/core/tokens/m2/mat/_full-pseudo-checkbox.scss +4 -4
- package/core/tokens/m2/mat/_grid-list.scss +4 -4
- package/core/tokens/m2/mat/_icon-button.scss +4 -4
- package/core/tokens/m2/mat/_icon.scss +4 -4
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +4 -4
- package/core/tokens/m2/mat/_list.scss +4 -4
- package/core/tokens/m2/mat/_menu.scss +4 -4
- package/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss +4 -4
- package/core/tokens/m2/mat/_optgroup.scss +4 -4
- package/core/tokens/m2/mat/_option.scss +4 -4
- package/core/tokens/m2/mat/_outlined-button.scss +4 -4
- package/core/tokens/m2/mat/_paginator.scss +4 -4
- package/core/tokens/m2/mat/_protected-button.scss +7 -7
- package/core/tokens/m2/mat/_radio.scss +4 -4
- package/core/tokens/m2/mat/_ripple.scss +4 -4
- package/core/tokens/m2/mat/_select.scss +7 -7
- package/core/tokens/m2/mat/_sidenav.scss +4 -4
- package/core/tokens/m2/mat/_slider.scss +4 -4
- package/core/tokens/m2/mat/_snack-bar.scss +4 -4
- package/core/tokens/m2/mat/_sort.scss +4 -4
- package/core/tokens/m2/mat/_standard-button-toggle.scss +4 -4
- package/core/tokens/m2/mat/_stepper.scss +4 -4
- package/core/tokens/m2/mat/_switch.scss +4 -4
- package/core/tokens/m2/mat/_tab-header-with-background.scss +4 -4
- package/core/tokens/m2/mat/_tab-header.scss +4 -4
- package/core/tokens/m2/mat/_table.scss +4 -4
- package/core/tokens/m2/mat/_text-button.scss +4 -4
- package/core/tokens/m2/mat/_toolbar.scss +4 -4
- package/core/tokens/m2/mat/_tree.scss +4 -4
- package/core/tokens/m2/mdc/_checkbox.scss +6 -7
- package/core/tokens/m2/mdc/_chip.scss +4 -4
- package/core/tokens/m2/mdc/_circular-progress.scss +4 -4
- package/core/tokens/m2/mdc/_dialog.scss +5 -5
- package/core/tokens/m2/mdc/_elevated-card.scss +4 -4
- package/core/tokens/m2/mdc/_extended-fab.scss +4 -4
- package/core/tokens/m2/mdc/_fab-small.scss +4 -4
- package/core/tokens/m2/mdc/_fab.scss +4 -4
- package/core/tokens/m2/mdc/_filled-button.scss +6 -7
- package/core/tokens/m2/mdc/_filled-text-field.scss +7 -7
- package/core/tokens/m2/mdc/_icon-button.scss +4 -4
- package/core/tokens/m2/mdc/_linear-progress.scss +4 -4
- package/core/tokens/m2/mdc/_list.scss +4 -4
- package/core/tokens/m2/mdc/_outlined-button.scss +5 -5
- package/core/tokens/m2/mdc/_outlined-card.scss +4 -4
- package/core/tokens/m2/mdc/_outlined-text-field.scss +7 -7
- package/core/tokens/m2/mdc/_plain-tooltip.scss +4 -4
- package/core/tokens/m2/mdc/_protected-button.scss +6 -7
- package/core/tokens/m2/mdc/_radio.scss +4 -4
- package/core/tokens/m2/mdc/_secondary-navigation-tab.scss +4 -4
- package/core/tokens/m2/mdc/_slider.scss +4 -4
- package/core/tokens/m2/mdc/_snack-bar.scss +4 -4
- package/core/tokens/m2/mdc/_switch.scss +4 -4
- package/core/tokens/m2/mdc/_tab-indicator.scss +4 -4
- package/core/tokens/m2/mdc/_text-button.scss +4 -4
- package/core/tokens/m3/definitions/_index.scss +94 -0
- package/core/tokens/m3/definitions/_md-comp-checkbox.scss +120 -0
- package/core/tokens/m3/definitions/_md-comp-circular-progress-indicator.scss +27 -0
- package/core/tokens/m3/definitions/_md-comp-data-table.scss +90 -0
- package/core/tokens/m3/definitions/_md-comp-dialog.scss +123 -0
- package/core/tokens/m3/definitions/_md-comp-elevated-button.scss +87 -0
- package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +53 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-primary.scss +90 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-secondary.scss +91 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-tertiary.scss +91 -0
- package/core/tokens/m3/definitions/_md-comp-fab-primary-small.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-fab-primary.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-fab-secondary-small.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-secondary.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-tertiary-small.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-tertiary.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-filled-button.scss +85 -0
- package/core/tokens/m3/definitions/_md-comp-filled-card.scss +52 -0
- package/core/tokens/m3/definitions/_md-comp-filled-icon-button.scss +73 -0
- package/core/tokens/m3/definitions/_md-comp-filled-text-field.scss +189 -0
- package/core/tokens/m3/definitions/_md-comp-icon-button.scss +64 -0
- package/core/tokens/m3/definitions/_md-comp-linear-progress-indicator.scss +29 -0
- package/core/tokens/m3/definitions/_md-comp-list.scss +252 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-button.scss +80 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-card.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-icon-button.scss +73 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-text-field.scss +171 -0
- package/core/tokens/m3/definitions/_md-comp-plain-tooltip.scss +51 -0
- package/core/tokens/m3/definitions/_md-comp-radio-button.scss +62 -0
- package/core/tokens/m3/definitions/_md-comp-secondary-navigation-tab.scss +80 -0
- package/core/tokens/m3/definitions/_md-comp-slider.scss +110 -0
- package/core/tokens/m3/definitions/_md-comp-snackbar.scss +125 -0
- package/core/tokens/m3/definitions/_md-comp-switch.scss +130 -0
- package/core/tokens/m3/definitions/_md-comp-text-button.scss +73 -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/definitions/unused/_md-comp-assist-chip.scss +105 -0
- package/core/tokens/m3/definitions/unused/_md-comp-badge.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-banner.scss +71 -0
- package/core/tokens/m3/definitions/unused/_md-comp-bottom-app-bar.scss +29 -0
- package/core/tokens/m3/definitions/unused/_md-comp-carousel-item.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-input-modal.scss +87 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-picker-docked.scss +248 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-picker-modal.scss +313 -0
- package/core/tokens/m3/definitions/unused/_md-comp-divider.scss +19 -0
- package/core/tokens/m3/definitions/unused/_md-comp-extended-fab-branded.scss +82 -0
- package/core/tokens/m3/definitions/unused/_md-comp-extended-fab-surface.scss +86 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-branded-large.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-branded.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-primary-large.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-secondary-large.scss +60 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface-large.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface-small.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-tertiary-large.scss +60 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-autocomplete.scss +269 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-menu-button.scss +94 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-select.scss +274 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-tonal-button.scss +95 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-tonal-icon-button.scss +80 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filter-chip.scss +205 -0
- package/core/tokens/m3/definitions/unused/_md-comp-full-screen-dialog.scss +109 -0
- package/core/tokens/m3/definitions/unused/_md-comp-input-chip.scss +180 -0
- package/core/tokens/m3/definitions/unused/_md-comp-menu.scss +31 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-bar.scss +110 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-drawer.scss +162 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-rail.scss +127 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-autocomplete.scss +259 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-menu-button.scss +90 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-segmented-button.scss +108 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-select.scss +264 -0
- package/core/tokens/m3/definitions/unused/_md-comp-primary-navigation-tab.scss +117 -0
- package/core/tokens/m3/definitions/unused/_md-comp-rich-tooltip.scss +121 -0
- package/core/tokens/m3/definitions/unused/_md-comp-scrim.scss +19 -0
- package/core/tokens/m3/definitions/unused/_md-comp-search-bar.scss +97 -0
- package/core/tokens/m3/definitions/unused/_md-comp-search-view.scss +91 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-bottom.scss +39 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-floating.scss +28 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-side.scss +87 -0
- package/core/tokens/m3/definitions/unused/_md-comp-standard-menu-button.scss +94 -0
- package/core/tokens/m3/definitions/unused/_md-comp-suggestion-chip.scss +121 -0
- package/core/tokens/m3/definitions/unused/_md-comp-time-input.scss +222 -0
- package/core/tokens/m3/definitions/unused/_md-comp-time-picker.scss +268 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-large.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-medium.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-small-centered.scss +62 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-small.scss +60 -0
- package/core/tokens/m3/mat/_app.scss +6 -3
- package/core/tokens/m3/mat/_autocomplete.scss +3 -4
- package/core/tokens/m3/mat/_badge.scss +18 -18
- package/core/tokens/m3/mat/_bottom-sheet.scss +4 -4
- package/core/tokens/m3/mat/_card.scss +4 -4
- package/core/tokens/m3/mat/_checkbox.scss +2 -2
- package/core/tokens/m3/mat/_chip.scss +5 -5
- package/core/tokens/m3/mat/_datepicker.scss +7 -7
- package/core/tokens/m3/mat/_dialog.scss +12 -11
- package/core/tokens/m3/mat/_divider.scss +3 -3
- package/core/tokens/m3/mat/_expansion.scss +7 -7
- package/core/tokens/m3/mat/_fab-small.scss +2 -2
- package/core/tokens/m3/mat/_fab.scss +2 -2
- package/core/tokens/m3/mat/_filled-button.scss +5 -5
- package/core/tokens/m3/mat/_form-field.scss +5 -5
- package/core/tokens/m3/mat/_full-pseudo-checkbox.scss +2 -2
- package/core/tokens/m3/mat/_grid-list.scss +2 -2
- package/core/tokens/m3/mat/_icon-button.scss +2 -2
- package/core/tokens/m3/mat/_icon.scss +3 -3
- package/core/tokens/m3/mat/_list.scss +2 -2
- package/core/tokens/m3/mat/_menu.scss +12 -12
- package/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss +2 -2
- package/core/tokens/m3/mat/_optgroup.scss +3 -3
- package/core/tokens/m3/mat/_option.scss +2 -2
- package/core/tokens/m3/mat/_outlined-button.scss +5 -5
- package/core/tokens/m3/mat/_paginator.scss +3 -3
- package/core/tokens/m3/mat/_protected-button.scss +5 -5
- package/core/tokens/m3/mat/_radio.scss +2 -2
- package/core/tokens/m3/mat/_ripple.scss +2 -2
- package/core/tokens/m3/mat/_select.scss +4 -4
- package/core/tokens/m3/mat/_sidenav.scss +6 -5
- package/core/tokens/m3/mat/_slider.scss +12 -10
- package/core/tokens/m3/mat/_snack-bar.scss +2 -2
- package/core/tokens/m3/mat/_sort.scss +2 -2
- package/core/tokens/m3/mat/_standard-button-toggle.scss +6 -5
- package/core/tokens/m3/mat/_stepper.scss +3 -3
- package/core/tokens/m3/mat/_switch.scss +27 -22
- package/core/tokens/m3/mat/_tab-header.scss +4 -4
- package/core/tokens/m3/mat/_table.scss +7 -6
- package/core/tokens/m3/mat/_text-button.scss +6 -6
- package/core/tokens/m3/mat/_toolbar.scss +3 -3
- package/core/tokens/m3/mat/_tree.scss +2 -2
- package/core/tokens/m3/mdc/_checkbox.scss +10 -8
- package/core/tokens/m3/mdc/_chip.scss +12 -11
- package/core/tokens/m3/mdc/_circular-progress.scss +5 -4
- package/core/tokens/m3/mdc/_dialog.scss +4 -4
- package/core/tokens/m3/mdc/_elevated-card.scss +3 -3
- package/core/tokens/m3/mdc/_extended-fab.scss +9 -5
- package/core/tokens/m3/mdc/_fab-small.scss +8 -5
- package/core/tokens/m3/mdc/_fab.scss +6 -5
- package/core/tokens/m3/mdc/_filled-button.scss +6 -6
- package/core/tokens/m3/mdc/_filled-text-field.scss +7 -6
- package/core/tokens/m3/mdc/_icon-button.scss +10 -8
- package/core/tokens/m3/mdc/_linear-progress.scss +5 -4
- package/core/tokens/m3/mdc/_list.scss +3 -3
- package/core/tokens/m3/mdc/_outlined-button.scss +7 -6
- package/core/tokens/m3/mdc/_outlined-card.scss +3 -3
- package/core/tokens/m3/mdc/_outlined-text-field.scss +7 -6
- package/core/tokens/m3/mdc/_plain-tooltip.scss +3 -3
- package/core/tokens/m3/mdc/_protected-button.scss +6 -6
- package/core/tokens/m3/mdc/_radio.scss +4 -3
- package/core/tokens/m3/mdc/_secondary-navigation-tab.scss +4 -3
- package/core/tokens/m3/mdc/_slider.scss +4 -3
- package/core/tokens/m3/mdc/_snack-bar.scss +3 -3
- package/core/tokens/m3/mdc/_switch.scss +4 -3
- package/core/tokens/m3/mdc/_tab-indicator.scss +5 -4
- package/core/tokens/m3/mdc/_text-button.scss +6 -6
- package/esm2022/autocomplete/animations.mjs +1 -2
- package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
- package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
- package/esm2022/autocomplete/autocomplete.mjs +5 -5
- package/esm2022/autocomplete/module.mjs +5 -5
- package/esm2022/badge/badge-module.mjs +5 -5
- package/esm2022/badge/badge.mjs +8 -8
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +5 -5
- 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 +9 -9
- package/esm2022/button/fab.mjs +17 -17
- package/esm2022/button/icon-button.mjs +9 -9
- package/esm2022/button/module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle.mjs +8 -8
- package/esm2022/card/card.mjs +44 -44
- package/esm2022/card/module.mjs +5 -5
- package/esm2022/checkbox/checkbox-config.mjs +2 -1
- package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
- package/esm2022/checkbox/checkbox.mjs +13 -7
- 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 +7 -7
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +7 -28
- 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 +5 -5
- package/esm2022/core/option/option.mjs +5 -5
- 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 +5 -5
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +5 -5
- package/esm2022/datepicker/calendar.mjs +8 -8
- package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
- package/esm2022/datepicker/date-range-input.mjs +6 -6
- 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 +8 -8
- 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 +8 -8
- 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 +5 -8
- package/esm2022/dialog/dialog-content-directives.mjs +16 -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 +5 -5
- 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 +11 -11
- package/esm2022/expansion/expansion-panel.mjs +9 -9
- 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 +9 -6
- 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 +6 -6
- package/esm2022/grid-list/grid-tile.mjs +17 -17
- 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 +39 -6
- package/esm2022/input/module.mjs +5 -5
- package/esm2022/list/action-list.mjs +5 -5
- 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 +6 -6
- package/esm2022/list/list.mjs +8 -8
- package/esm2022/list/nav-list.mjs +5 -5
- package/esm2022/list/selection-list.mjs +6 -6
- package/esm2022/list/subheader.mjs +4 -4
- package/esm2022/list/testing/selection-list-harness.mjs +2 -2
- 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 +5 -5
- 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 +5 -5
- package/esm2022/progress-bar/module.mjs +5 -5
- package/esm2022/progress-bar/progress-bar.mjs +5 -5
- package/esm2022/progress-spinner/module.mjs +5 -5
- package/esm2022/progress-spinner/progress-spinner.mjs +5 -5
- package/esm2022/radio/module.mjs +5 -5
- package/esm2022/radio/radio.mjs +62 -24
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +9 -9
- package/esm2022/sidenav/drawer.mjs +12 -12
- package/esm2022/sidenav/sidenav-module.mjs +5 -5
- package/esm2022/sidenav/sidenav.mjs +12 -12
- package/esm2022/slide-toggle/module.mjs +9 -9
- package/esm2022/slide-toggle/slide-toggle-config.mjs +2 -2
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
- package/esm2022/slide-toggle/slide-toggle.mjs +17 -11
- 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 +5 -5
- 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 +5 -5
- 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 +5 -5
- 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 +5 -5
- 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 +8 -8
- 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 +9 -9
- 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 +6 -6
- package/esm2022/tabs/tab-header.mjs +5 -5
- 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 +12 -12
- package/esm2022/tabs/tab.mjs +4 -4
- package/esm2022/tabs/testing/tab-harness.mjs +2 -2
- package/esm2022/toolbar/toolbar-module.mjs +5 -5
- package/esm2022/toolbar/toolbar.mjs +8 -8
- 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 +5 -5
- package/fesm2022/autocomplete.mjs +14 -15
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +11 -11
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +11 -11
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +11 -11
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +42 -42
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +47 -47
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +24 -17
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +48 -69
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +62 -62
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +88 -88
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +26 -29
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +8 -8
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +28 -28
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +39 -36
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +25 -25
- 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 +42 -9
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +56 -56
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +17 -17
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +11 -11
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +8 -8
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +8 -8
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +65 -27
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +26 -26
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +28 -22
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +17 -17
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +23 -23
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +14 -14
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +33 -33
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +57 -57
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +48 -48
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +11 -11
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +14 -11
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-focus-overlay.scss +1 -1
- package/form-field/_mdc-text-field-density-overrides.scss +4 -4
- package/form-field/_mdc-text-field-structure.scss +6 -6
- package/input/index.d.ts +13 -1
- package/list/testing/index.d.ts +1 -1
- package/package.json +3 -51
- 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/radio/_radio-common.scss +26 -8
- package/radio/index.d.ts +19 -5
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/slide-toggle/index.d.ts +6 -1
- package/tabs/testing/index.d.ts +1 -1
- package/tooltip/index.d.ts +5 -0
- package/core/mdc-helpers/_mdc-helpers.scss +0 -60
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '@material/tokens/v0_161' as mdc-tokens;
|
|
3
2
|
@use '../style/sass-utils';
|
|
4
3
|
@use '../m2' as m2-theming;
|
|
5
4
|
@use './m3';
|
|
5
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
6
6
|
@use '../tokens/m2' as m2-tokens;
|
|
7
|
+
@use '../style/elevation';
|
|
7
8
|
@use './density';
|
|
8
9
|
@use './format-tokens';
|
|
9
10
|
|
|
11
|
+
// Default system level prefix to use when directly calling the `system-level-*` mixins
|
|
12
|
+
$_system-level-prefix: sys;
|
|
13
|
+
|
|
14
|
+
// Prefix used for component token fallback variables, e.g.
|
|
15
|
+
// `color: var(--mdc-text-button-label-text-color, var(--mat-app-primary));`
|
|
16
|
+
$_system-fallback-prefix: mat-app;
|
|
17
|
+
|
|
10
18
|
/// Generates tokens for the given palette with the given prefix.
|
|
11
19
|
/// @param {Map} $palette The palette to generate tokens for
|
|
12
20
|
/// @param {String} $prefix The key prefix used to name the tokens
|
|
@@ -21,7 +29,7 @@
|
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
24
|
-
///
|
|
32
|
+
/// ./m3/definitions/_md-ref-palette.scss)
|
|
25
33
|
/// @param {Map} $primary The primary palette
|
|
26
34
|
/// @param {Map} $secondary The secondary palette
|
|
27
35
|
/// @param {Map} $tertiary The tertiary palette
|
|
@@ -40,7 +48,7 @@
|
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
43
|
-
///
|
|
51
|
+
/// ./m3/definitions/_md-ref-typeface.scss)
|
|
44
52
|
/// @param {List|String} $brand The font-family to use for brand text
|
|
45
53
|
/// @param {List|String} $plain The font-family to use for plain text
|
|
46
54
|
/// @param {String} $bold The font-weight to use for bold text
|
|
@@ -86,8 +94,9 @@ $_cached-token-slots: null;
|
|
|
86
94
|
/// Generates a set of namespaced tokens for all components.
|
|
87
95
|
/// @param {Map} $systems The MDC system tokens
|
|
88
96
|
/// @param {Boolean} $include-non-systemized Whether to include non-systemized tokens
|
|
97
|
+
/// @param {Boolean} $include-density Whether to include density tokens
|
|
89
98
|
/// @return {Map} A map of namespaced tokens
|
|
90
|
-
@function _generate-tokens($systems, $include-non-systemized: false) {
|
|
99
|
+
@function _generate-tokens($systems, $include-non-systemized: false, $include-density: false) {
|
|
91
100
|
$systems: map.merge((
|
|
92
101
|
md-sys-color: (),
|
|
93
102
|
md-sys-elevation: (),
|
|
@@ -116,16 +125,63 @@ $_cached-token-slots: null;
|
|
|
116
125
|
// Strip out tokens that are systemized by our made up density system.
|
|
117
126
|
@each $namespace, $tokens in $result {
|
|
118
127
|
@each $token, $value in $tokens {
|
|
119
|
-
@if density.is-systemized($namespace, $token) {
|
|
128
|
+
@if density.is-systemized($namespace, $token) and not $include-density {
|
|
120
129
|
$tokens: map.remove($tokens, $token);
|
|
121
130
|
}
|
|
122
131
|
}
|
|
123
132
|
$result: map.set($result, $namespace, $tokens);
|
|
124
133
|
}
|
|
134
|
+
|
|
125
135
|
@return $result;
|
|
126
136
|
}
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
// Return a new map where the values are the same as the provided map's
|
|
139
|
+
// keys, prefixed with "--mat-app-". For example:
|
|
140
|
+
// (key1: '', key2: '') --> (key1: --mat-app-key1, key2: --mat-app-key2)
|
|
141
|
+
@function _create-system-app-vars-map($map) {
|
|
142
|
+
$new-map: ();
|
|
143
|
+
@each $key, $value in $map {
|
|
144
|
+
$new-map: map.set($new-map, $key, --#{$_system-fallback-prefix}-#{$key});
|
|
145
|
+
}
|
|
146
|
+
@return $new-map;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Create a components tokens map where values are based on
|
|
150
|
+
// system fallback variables referencing Material's system keys.
|
|
151
|
+
// Includes density token fallbacks where density is 0.
|
|
152
|
+
@function create-system-fallbacks() {
|
|
153
|
+
$app-vars: (
|
|
154
|
+
'md-sys-color':
|
|
155
|
+
_create-system-app-vars-map(m3-token-definitions.md-sys-color-values-light()),
|
|
156
|
+
'md-sys-typescale':
|
|
157
|
+
_create-system-app-vars-map(m3-token-definitions.md-sys-typescale-values()),
|
|
158
|
+
'md-sys-elevation':
|
|
159
|
+
_create-system-app-vars-map(m3-token-definitions.md-sys-elevation-values()),
|
|
160
|
+
'md-sys-state':
|
|
161
|
+
_create-system-app-vars-map(m3-token-definitions.md-sys-state-values()),
|
|
162
|
+
'md-sys-shape':
|
|
163
|
+
_create-system-app-vars-map(m3-token-definitions.md-sys-shape-values()),
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
@return sass-utils.deep-merge-all(
|
|
167
|
+
_generate-tokens($app-vars, true, true),
|
|
168
|
+
generate-density-tokens(0)
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Emits CSS variables for Material's system level values. Uses the
|
|
173
|
+
// namespace prefix in $_system-fallback-prefix.
|
|
174
|
+
// e.g. --mat-app-surface: #E5E5E5
|
|
175
|
+
@mixin theme($theme, $overrides: ()) {
|
|
176
|
+
@include system-level-colors($theme, $overrides, $_system-fallback-prefix);
|
|
177
|
+
@include system-level-typography($theme, $overrides, $_system-fallback-prefix);
|
|
178
|
+
@include system-level-elevation($theme, $overrides, $_system-fallback-prefix);
|
|
179
|
+
@include system-level-shape($theme, $overrides, $_system-fallback-prefix);
|
|
180
|
+
@include system-level-motion($theme, $overrides, $_system-fallback-prefix);
|
|
181
|
+
@include system-level-state($theme, $overrides, $_system-fallback-prefix);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@mixin system-level-colors($theme, $overrides: (), $prefix: null) {
|
|
129
185
|
$palettes: map.get($theme, _mat-theming-internals-do-not-access, palettes);
|
|
130
186
|
$base-palettes: (
|
|
131
187
|
neutral: map.get($palettes, neutral),
|
|
@@ -135,40 +191,46 @@ $_cached-token-slots: null;
|
|
|
135
191
|
);
|
|
136
192
|
|
|
137
193
|
$type: map.get($theme, _mat-theming-internals-do-not-access, theme-type);
|
|
138
|
-
$system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
|
|
139
194
|
$primary: map.merge(map.get($palettes, primary), $base-palettes);
|
|
140
195
|
$tertiary: map.merge(map.get($palettes, tertiary), $base-palettes);
|
|
141
196
|
$error: map.get($palettes, error);
|
|
142
197
|
|
|
198
|
+
@if (not $prefix) {
|
|
199
|
+
$prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
200
|
+
color-system-variables-prefix) or $_system-level-prefix;
|
|
201
|
+
}
|
|
202
|
+
|
|
143
203
|
$ref: (
|
|
144
204
|
md-ref-palette: _generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
145
205
|
);
|
|
146
206
|
|
|
147
207
|
$sys-colors: if($type == dark,
|
|
148
|
-
|
|
149
|
-
|
|
208
|
+
m3-token-definitions.md-sys-color-values-dark($ref),
|
|
209
|
+
m3-token-definitions.md-sys-color-values-light($ref));
|
|
150
210
|
|
|
151
211
|
@each $name, $value in $sys-colors {
|
|
152
|
-
--#{$
|
|
212
|
+
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
153
213
|
}
|
|
154
214
|
}
|
|
155
215
|
|
|
156
|
-
@mixin system-level-typography($theme, $overrides: ()) {
|
|
216
|
+
@mixin system-level-typography($theme, $overrides: (), $prefix: null) {
|
|
157
217
|
$font-definition: map.get($theme, _mat-theming-internals-do-not-access, font-definition);
|
|
158
218
|
$brand: map.get($font-definition, brand);
|
|
159
219
|
$plain: map.get($font-definition, plain);
|
|
160
220
|
$bold: map.get($font-definition, bold);
|
|
161
221
|
$medium: map.get($font-definition, medium);
|
|
162
222
|
$regular: map.get($font-definition, regular);
|
|
163
|
-
$system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
|
|
164
223
|
$ref: (
|
|
165
224
|
md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
166
225
|
);
|
|
167
226
|
|
|
168
|
-
|
|
227
|
+
@if (not $prefix) {
|
|
228
|
+
$prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
229
|
+
typography-system-variables-prefix) or $_system-level-prefix;
|
|
230
|
+
}
|
|
169
231
|
|
|
170
|
-
@each $name, $value in
|
|
171
|
-
--#{$
|
|
232
|
+
@each $name, $value in m3-token-definitions.md-sys-typescale-values($ref) {
|
|
233
|
+
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
172
234
|
}
|
|
173
235
|
}
|
|
174
236
|
|
|
@@ -180,10 +242,44 @@ $_cached-token-slots: null;
|
|
|
180
242
|
@return $result;
|
|
181
243
|
}
|
|
182
244
|
|
|
245
|
+
@mixin system-level-elevation($theme, $overrides: (), $prefix: $_system-level-prefix) {
|
|
246
|
+
$shadow-color: map.get(
|
|
247
|
+
$theme, _mat-theming-internals-do-not-access, color-tokens, (mdc, theme), shadow);
|
|
248
|
+
|
|
249
|
+
@for $level from 0 through 24 {
|
|
250
|
+
$value: elevation.get-box-shadow($level, $shadow-color);
|
|
251
|
+
--#{$prefix}-elevation-shadow-level-#{$level}: #{$value};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@each $name, $value in m3-token-definitions.md-sys-elevation-values() {
|
|
255
|
+
$level: map.get($overrides, $name) or $value;
|
|
256
|
+
$value: elevation.get-box-shadow($level, $shadow-color);
|
|
257
|
+
--#{$prefix}-#{$name}: #{$value};
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@mixin system-level-shape($theme, $overrides: (), $prefix: $_system-level-prefix) {
|
|
262
|
+
@each $name, $value in m3-token-definitions.md-sys-shape-values() {
|
|
263
|
+
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@mixin system-level-state($theme, $overrides: (), $prefix: $_system-level-prefix) {
|
|
268
|
+
@each $name, $value in m3-token-definitions.md-sys-state-values() {
|
|
269
|
+
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@mixin system-level-motion($theme, $overrides: (), $prefix: $_system-level-prefix) {
|
|
274
|
+
@each $name, $value in m3-token-definitions.md-sys-motion-values() {
|
|
275
|
+
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
183
279
|
@function _get-sys-color($type, $ref, $prefix) {
|
|
184
280
|
$mdc-sys-color: if($type == dark,
|
|
185
|
-
|
|
186
|
-
|
|
281
|
+
m3-token-definitions.md-sys-color-values-dark($ref),
|
|
282
|
+
m3-token-definitions.md-sys-color-values-light($ref));
|
|
187
283
|
|
|
188
284
|
@if (sass-utils.$use-system-color-variables) {
|
|
189
285
|
$keys: (
|
|
@@ -343,7 +439,7 @@ $_cached-token-slots: null;
|
|
|
343
439
|
|
|
344
440
|
@return create-map($keys, $prefix);
|
|
345
441
|
}
|
|
346
|
-
@return
|
|
442
|
+
@return m3-token-definitions.md-sys-typescale-values($ref);
|
|
347
443
|
}
|
|
348
444
|
|
|
349
445
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -364,12 +460,12 @@ $_cached-token-slots: null;
|
|
|
364
460
|
md-sys-color: $sys-color,
|
|
365
461
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
366
462
|
// elevation needs to be part of the color dimension.
|
|
367
|
-
md-sys-elevation:
|
|
463
|
+
md-sys-elevation: m3-token-definitions.md-sys-elevation-values(),
|
|
368
464
|
// Because the state values are sometimes combined with color values to create rgba colors,
|
|
369
465
|
// state needs to be part of color dimension.
|
|
370
466
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
371
467
|
// state to the base dimension.
|
|
372
|
-
md-sys-state:
|
|
468
|
+
md-sys-state: m3-token-definitions.md-sys-state-values(),
|
|
373
469
|
)));
|
|
374
470
|
}
|
|
375
471
|
|
|
@@ -405,7 +501,7 @@ $system-variables-prefix) {
|
|
|
405
501
|
@function generate-base-tokens() {
|
|
406
502
|
// TODO(mmalerba): Exclude density tokens once implemented.
|
|
407
503
|
@return _generate-tokens((
|
|
408
|
-
md-sys-motion:
|
|
409
|
-
md-sys-shape:
|
|
504
|
+
md-sys-motion: m3-token-definitions.md-sys-motion-values(),
|
|
505
|
+
md-sys-shape: m3-token-definitions.md-sys-shape-values(),
|
|
410
506
|
), $include-non-systemized: true);
|
|
411
507
|
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use 'sass:list';
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use 'sass:math';
|
|
6
|
+
@use '../m2/palette' as m2-palette;
|
|
7
|
+
@use '../m2/theming' as m2-theming;
|
|
8
|
+
@use '../m2/typography' as m2-typography;
|
|
9
|
+
@use '../style/sass-utils';
|
|
10
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
11
|
+
|
|
12
|
+
// Indicates whether we're building internally. Used for backwards compatibility.
|
|
13
|
+
$private-is-internal-build: false;
|
|
14
|
+
|
|
15
|
+
$_placeholder-color-palette: m2-theming.define-palette(m2-palette.$red-palette);
|
|
16
|
+
|
|
17
|
+
// Placeholder color config that can be passed to token getter functions when generating token
|
|
18
|
+
// slots.
|
|
19
|
+
$placeholder-color-config: (
|
|
20
|
+
primary: $_placeholder-color-palette,
|
|
21
|
+
accent: $_placeholder-color-palette,
|
|
22
|
+
warn: $_placeholder-color-palette,
|
|
23
|
+
is-dark: false,
|
|
24
|
+
foreground: m2-palette.$light-theme-foreground-palette,
|
|
25
|
+
background: m2-palette.$light-theme-background-palette,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
$_placeholder-typography-level-config: m2-typography.typography-config-level-from-mdc(body1);
|
|
29
|
+
|
|
30
|
+
// Placeholder typography config that can be passed to token getter functions when generating token
|
|
31
|
+
// slots.
|
|
32
|
+
$placeholder-typography-config: (
|
|
33
|
+
font-family: 'Roboto, sans-serif',
|
|
34
|
+
headline-1: $_placeholder-typography-level-config,
|
|
35
|
+
headline-2: $_placeholder-typography-level-config,
|
|
36
|
+
headline-3: $_placeholder-typography-level-config,
|
|
37
|
+
headline-4: $_placeholder-typography-level-config,
|
|
38
|
+
headline-5: $_placeholder-typography-level-config,
|
|
39
|
+
headline-6: $_placeholder-typography-level-config,
|
|
40
|
+
subtitle-1: $_placeholder-typography-level-config,
|
|
41
|
+
subtitle-2: $_placeholder-typography-level-config,
|
|
42
|
+
body-1: $_placeholder-typography-level-config,
|
|
43
|
+
body-2: $_placeholder-typography-level-config,
|
|
44
|
+
caption: $_placeholder-typography-level-config,
|
|
45
|
+
button: $_placeholder-typography-level-config,
|
|
46
|
+
overline: $_placeholder-typography-level-config,
|
|
47
|
+
subheading-1: $_placeholder-typography-level-config,
|
|
48
|
+
title: $_placeholder-typography-level-config,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Placeholder density config that can be passed to token getter functions when generating token
|
|
52
|
+
// slots.
|
|
53
|
+
$placeholder-density-config: 0;
|
|
54
|
+
|
|
55
|
+
$_tokens: null;
|
|
56
|
+
$_component-prefix: null;
|
|
57
|
+
$_system-fallbacks: null;
|
|
58
|
+
|
|
59
|
+
/// Gets all the MDC token values for a specific component. This function serves as single
|
|
60
|
+
/// point at which we directly reference a specific version of the MDC tokens.
|
|
61
|
+
/// @param {String} $component Name of the component for which to get the tokens
|
|
62
|
+
/// @param {Map} $systems The MDC system tokens
|
|
63
|
+
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
64
|
+
/// @return {List} Map of token names to values
|
|
65
|
+
@function get-mdc-tokens($component, $systems, $exclude-hardcoded) {
|
|
66
|
+
$full-name: 'md-comp-' + $component + '-values';
|
|
67
|
+
$fn: meta.get-function($name: $full-name, $module: 'm3-token-definitions');
|
|
68
|
+
@return meta.call($fn, $systems, $exclude-hardcoded);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// Gets the MDC tokens for the given prefix, M3 token values, and supported token slots.
|
|
72
|
+
/// @param {List} $prefix The token prefix for the given tokens.
|
|
73
|
+
/// @param {Map|(Map, Map)} $values A map of M3 token values for the given prefix.
|
|
74
|
+
/// This param may also be a tuple of maps, the first one representing the default M3 token values,
|
|
75
|
+
// and the second containing overrides for different color variants.
|
|
76
|
+
// Single map example:
|
|
77
|
+
// (token1: green, token2: 2px)
|
|
78
|
+
// Tuple example:
|
|
79
|
+
// (
|
|
80
|
+
// (token1: green, token2: 2px),
|
|
81
|
+
// (
|
|
82
|
+
// secondary: (token1: blue),
|
|
83
|
+
// error: (token1: red),
|
|
84
|
+
// )
|
|
85
|
+
// )
|
|
86
|
+
/// @param {Map} $slots A map of token slots, with null value indicating the token is not supported.
|
|
87
|
+
/// @param {String|null} $variant The name of the variant the token values are for.
|
|
88
|
+
/// @return {Map} A map of fully qualified token names to values, for only the supported tokens.
|
|
89
|
+
@function namespace-tokens($prefix, $values, $slots, $variant: null) {
|
|
90
|
+
$result: ();
|
|
91
|
+
@if $variant == null and meta.type-of($values) == 'list' and list.length($values == 2) {
|
|
92
|
+
$variants: list.nth($values, 2);
|
|
93
|
+
$values: list.nth($values, 1);
|
|
94
|
+
@each $variant, $overrides in $variants {
|
|
95
|
+
$result: map.merge($result, namespace-tokens($prefix, $overrides, $slots, $variant));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
$used-token-names: map.keys(_filter-nulls(map.get($slots, $prefix)));
|
|
99
|
+
$used-m3-tokens: _pick(_filter-nulls($values), $used-token-names);
|
|
100
|
+
$prefix: if($variant == null, $prefix, list.append($prefix, $variant));
|
|
101
|
+
@return map.merge($result, ($prefix: $used-m3-tokens));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// Hardcode the given value, or null if hardcoded values are excluded.
|
|
105
|
+
@function hardcode($value, $exclude-hardcoded) {
|
|
106
|
+
@return if($exclude-hardcoded, null, $value);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/// Sets all of the standard typography tokens for the given token base name to the given typography
|
|
110
|
+
/// level.
|
|
111
|
+
/// @param {Map} $systems The MDC system tokens
|
|
112
|
+
/// @param {String} $base-name The token base name to get the typography tokens for
|
|
113
|
+
/// @param {String} $typography-level The typography level to base the token values on
|
|
114
|
+
/// @return {Map} A map containing the typography tokens for the given base token name
|
|
115
|
+
@function generate-typography-tokens($systems, $base-name, $typography-level) {
|
|
116
|
+
$result: ();
|
|
117
|
+
@each $prop in (font, line-height, size, tracking, weight) {
|
|
118
|
+
$result: map.set($result, #{$base-name}-#{$prop},
|
|
119
|
+
map.get($systems, md-sys-typescale, #{$typography-level}-#{$prop}));
|
|
120
|
+
}
|
|
121
|
+
@return $result;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/// Maps the values in a map to new values using the given mapping function
|
|
125
|
+
/// @param {Map} $map The maps whose values will be mapped to new values.
|
|
126
|
+
/// @param {Function} $fn The value mapping function.
|
|
127
|
+
/// @param {Map} A new map with its values updated using the mapping function.
|
|
128
|
+
@function map-values($map, $fn) {
|
|
129
|
+
$result: ();
|
|
130
|
+
@each $key, $value in $map {
|
|
131
|
+
$result: map.set($result, $key, meta.call($fn, $value));
|
|
132
|
+
}
|
|
133
|
+
@return $result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/// Renames the keys in a map
|
|
137
|
+
/// @param {Map} $map The map whose keys should be renamed
|
|
138
|
+
/// @param {Map} $rename-keys A map of original key to renamed key to apply to $map
|
|
139
|
+
/// @return {Map} The result of applying the given key renames to the given map.
|
|
140
|
+
@function rename-map-keys($map, $rename-keys) {
|
|
141
|
+
$result: $map;
|
|
142
|
+
@each $old-key-name, $new-key-name in $rename-keys {
|
|
143
|
+
@if map.has-key($map, $old-key-name) {
|
|
144
|
+
$result: map.set($result, $new-key-name, map.get($map, $old-key-name));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
@return $result;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/// At the time of writing, some color tokens (e.g. disabled state) are defined as a solid color
|
|
151
|
+
/// token and a separate opacity token. This function applies the opacity to the color and drops the
|
|
152
|
+
/// opacity key from the map. Can be removed once b/213331407 is resolved.
|
|
153
|
+
/// @param {Map} $tokens The map of tokens currently being generated
|
|
154
|
+
/// @param {Map} $all-tokens A map of all tokens, including hardcoded values
|
|
155
|
+
/// @param {List} $pairs Pairs of color token names and their opacities. Should be in the shape of
|
|
156
|
+
/// `((color: 'color-key', opacity: 'opacity-key'))`.
|
|
157
|
+
/// @return {Map} The initial tokens with the combined color values.
|
|
158
|
+
@function combine-color-tokens($tokens, $opacity-lookup, $pairs) {
|
|
159
|
+
$result: $tokens;
|
|
160
|
+
|
|
161
|
+
@each $pair in $pairs {
|
|
162
|
+
$color-key: map.get($pair, color);
|
|
163
|
+
$opacity-key: map.get($pair, opacity);
|
|
164
|
+
$color: map.get($tokens, $color-key);
|
|
165
|
+
|
|
166
|
+
@if (sass-utils.is-css-var-name($color)) {
|
|
167
|
+
$color: var(#{$color});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
$opacity: map.get($opacity-lookup, $opacity-key);
|
|
171
|
+
|
|
172
|
+
@if(meta.type-of($color) == 'color') {
|
|
173
|
+
$result: map.remove($result, $opacity-key);
|
|
174
|
+
$result: map.set($result, $color-key, rgba($color, $opacity));
|
|
175
|
+
}
|
|
176
|
+
@else if($color != null) {
|
|
177
|
+
$result: map.remove($result, $opacity-key);
|
|
178
|
+
$combined-color: #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)};
|
|
179
|
+
$result: map.set($result, $color-key, $combined-color);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@return $result;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
|
|
187
|
+
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
|
|
188
|
+
/// backwards compatibility.
|
|
189
|
+
/// @param {Color} $value Color for which we're calculating the contrast tone.
|
|
190
|
+
/// @param {Boolean} $is-dark Whether the current theme is dark.
|
|
191
|
+
/// @return {Map} Either `dark` or `light`.
|
|
192
|
+
@function contrast-tone($value, $is-dark) {
|
|
193
|
+
@if ($value == 'dark') {
|
|
194
|
+
@return 'light';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@if ($value == 'light') {
|
|
198
|
+
@return 'dark';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Fallback if the app is using a non-color palette (e.g. CSS variable based).
|
|
202
|
+
@if (meta.type-of($value) != 'color') {
|
|
203
|
+
@return if($is-dark, 'light', 'dark');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
$minimum-contrast: 3.1;
|
|
207
|
+
$light-contrast: _contrast($value, #fff);
|
|
208
|
+
$dark-contrast: _contrast($value, rgba(0, 0, 0, 0.87));
|
|
209
|
+
|
|
210
|
+
@if ($light-contrast < $minimum-contrast) and ($dark-contrast > $light-contrast) {
|
|
211
|
+
@return 'dark';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@return 'light';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@function _linear-channel-value($channel-value) {
|
|
218
|
+
$normalized-channel-value: math.div($channel-value, 255);
|
|
219
|
+
|
|
220
|
+
@if ($normalized-channel-value < 0.03928) {
|
|
221
|
+
@return math.div($normalized-channel-value, 12.92);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@return math.pow(math.div($normalized-channel-value + 0.055, 1.055), 2.4);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Calculate the luminance for a color.
|
|
228
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
229
|
+
@function _luminance($color) {
|
|
230
|
+
$red: _linear-channel-value(color.red($color));
|
|
231
|
+
$green: _linear-channel-value(color.green($color));
|
|
232
|
+
$blue: _linear-channel-value(color.blue($color));
|
|
233
|
+
|
|
234
|
+
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Calculate the contrast ratio between two colors.
|
|
238
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
239
|
+
@function _contrast($back, $front) {
|
|
240
|
+
$back-lum: _luminance($back) + 0.05;
|
|
241
|
+
$fore-lum: _luminance($front) + 0.05;
|
|
242
|
+
|
|
243
|
+
@return math.div(math.max($back-lum, $fore-lum), math.min($back-lum, $fore-lum));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/// Picks a submap containing only the given keys out the given map.
|
|
247
|
+
/// @param {Map} $map The map to pick from.
|
|
248
|
+
/// @param {List} $keys The map keys to pick.
|
|
249
|
+
/// @return {Map} A submap containing only the given keys.
|
|
250
|
+
@function _pick($map, $keys) {
|
|
251
|
+
$result: ();
|
|
252
|
+
@each $key in $keys {
|
|
253
|
+
@if map.has-key($map, $key) {
|
|
254
|
+
$result: map.set($result, $key, map.get($map, $key));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
@return $result;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
/// Filters keys with a null value out of the map.
|
|
262
|
+
/// @param {Map} $map The map to filter.
|
|
263
|
+
/// @return {Map} The given map with all of the null keys filtered out.
|
|
264
|
+
@function _filter-nulls($map) {
|
|
265
|
+
$result: ();
|
|
266
|
+
@each $key, $val in $map {
|
|
267
|
+
@if $val != null {
|
|
268
|
+
$result: map.set($result, $key, $val);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
@return $result;
|
|
272
|
+
}
|