mirror of
https://github.com/material-components/material-web.git
synced 2024-08-17 09:30:27 +03:00
chore(tokens): rename tokens/internal/values
tokens/internal/validate
The naming is a bit backwards. The file is about validation and the function is for the token values, not a file just for token values. PiperOrigin-RevId: 599207580
This commit is contained in:
parent
b986b1eb7c
commit
a3a05e4179
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -86,7 +86,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-assist-chip.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -90,7 +90,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-checkbox.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -8,7 +8,7 @@
|
||||
@use 'sass:math';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './v0_192/md-comp-circular-progress-indicator';
|
||||
@ -39,7 +39,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-circular-progress-indicator.values(
|
||||
$deps,
|
||||
$exclude-hardcoded-values
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -73,7 +73,7 @@ $unsupported-tokens: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-dialog.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './v0_192/md-comp-divider';
|
||||
// go/keep-sorted end
|
||||
@ -21,7 +21,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
@return values.validate(
|
||||
@return validate.values(
|
||||
md-comp-divider.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens
|
||||
);
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -77,7 +77,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-elevated-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -53,7 +53,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-elevated-card.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
// go/keep-sorted end
|
||||
@ -29,5 +29,5 @@ $_default: (
|
||||
'level': map.get($deps, 'md-sys-elevation', 'level0'),
|
||||
'shadow-color': map.get($deps, 'md-sys-color', 'shadow'),
|
||||
);
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -100,7 +100,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-fab-branded.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -234,7 +234,7 @@ $_default: (
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: md-comp-fab-surface.values($deps, $exclude-hardcoded-values);
|
||||
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
$tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -77,7 +77,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -53,7 +53,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-card.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -249,5 +249,5 @@ $_default: (
|
||||
// go/keep-sorted end
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -65,7 +65,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-icon-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -159,7 +159,7 @@ $_default: (
|
||||
$original-tokens,
|
||||
_get-override-tokens($exclude-hardcoded-values)
|
||||
);
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
$original-tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -120,7 +120,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-text-field.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -77,7 +77,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-tonal-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -65,7 +65,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filled-tonal-icon-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -128,7 +128,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-filter-chip.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -8,7 +8,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-motion';
|
||||
@use './md-sys-shape';
|
||||
@ -43,5 +43,5 @@ $_default: (
|
||||
'width': if($exclude-hardcoded-values, null, 3px),
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -54,7 +54,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-icon-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
// go/keep-sorted end
|
||||
|
||||
$supported-tokens: (
|
||||
@ -24,7 +24,7 @@ $supported-tokens: (
|
||||
}
|
||||
|
||||
@function values($exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
(),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$new-tokens: _get-new-tokens($exclude-hardcoded-values)
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -116,7 +116,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-input-chip.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-typescale';
|
||||
@use './v0_192/md-comp-list';
|
||||
@ -83,5 +83,5 @@ $_default: (
|
||||
// go/keep-sorted end
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './v0_192/md-comp-linear-progress-indicator';
|
||||
@ -42,7 +42,7 @@ $unsupported-tokens: (
|
||||
// TODO(b/275045611) may need to update based on resolution of design
|
||||
// for buffer and background animation.
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
@return values.validate(
|
||||
@return validate.values(
|
||||
md-comp-linear-progress-indicator.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -9,7 +9,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-state';
|
||||
@use './md-sys-typescale';
|
||||
@ -128,7 +128,7 @@ $_default: (
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$original-tokens: md-comp-list.values($deps, $exclude-hardcoded-values);
|
||||
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
$original-tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './v0_192/md-comp-list';
|
||||
// go/keep-sorted end
|
||||
@ -28,5 +28,5 @@ $_default: (
|
||||
'container-color': map.get($list-tokens, 'list-item-container-color'),
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -41,7 +41,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-menu.values($deps),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -11,7 +11,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-state';
|
||||
@use './md-sys-typescale';
|
||||
@ -130,7 +130,7 @@ $_default: (
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$original-tokens: md-comp-list.values($deps, $exclude-hardcoded-values);
|
||||
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
$original-tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -9,7 +9,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -41,7 +41,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-menu.values($deps),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -73,7 +73,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -59,7 +59,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-card.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -224,5 +224,5 @@ $_default: (
|
||||
// go/keep-sorted end
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -58,7 +58,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-icon-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -6,7 +6,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -75,7 +75,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-segmented-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -8,7 +8,7 @@
|
||||
@use 'sass:string';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -137,7 +137,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-select.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-typescale';
|
||||
@ -111,7 +111,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-outlined-text-field.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -83,7 +83,7 @@ $_default: (
|
||||
$exclude-hardcoded-values: $exclude-hardcoded-values
|
||||
);
|
||||
|
||||
@return values.validate(
|
||||
@return validate.values(
|
||||
$tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-state';
|
||||
@use './v0_192/md-comp-radio-button';
|
||||
@ -52,7 +52,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-radio-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -36,5 +36,5 @@ $_default: (
|
||||
map.get($deps, 'md-sys-state', 'pressed-state-layer-opacity'),
|
||||
);
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -83,7 +83,7 @@ $_default: (
|
||||
|
||||
$tokens: _add-missing-secondary-tokens($tokens);
|
||||
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
$tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -88,7 +88,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-slider.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-elevation';
|
||||
@use './md-sys-shape';
|
||||
@ -86,7 +86,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-suggestion-chip.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -97,7 +97,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-switch.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-sys-color';
|
||||
@use './md-sys-shape';
|
||||
@use './md-sys-state';
|
||||
@ -66,7 +66,7 @@ $_default: (
|
||||
);
|
||||
|
||||
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
||||
$tokens: values.validate(
|
||||
$tokens: validate.values(
|
||||
md-comp-text-button.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './v0_192/md-ref-palette';
|
||||
// go/keep-sorted end
|
||||
|
||||
@ -105,7 +105,7 @@ $supported-tokens: (
|
||||
);
|
||||
|
||||
@function values($exclude-hardcoded-values: false) {
|
||||
@return values.validate(
|
||||
@return validate.values(
|
||||
md-ref-palette.values($exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens
|
||||
);
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './v0_192/md-ref-typeface';
|
||||
// go/keep-sorted end
|
||||
|
||||
@ -42,5 +42,5 @@ $supported-tokens: (
|
||||
}
|
||||
}
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-ref-palette';
|
||||
@use './v0_192/md-sys-color';
|
||||
// go/keep-sorted end
|
||||
@ -89,7 +89,7 @@ $_default-dark: (
|
||||
}
|
||||
}
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
||||
$_default-light: (
|
||||
@ -115,5 +115,5 @@ $_default-light: (
|
||||
}
|
||||
}
|
||||
|
||||
@return values.validate($tokens, $supported-tokens: $supported-tokens);
|
||||
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@use 'sass:map';
|
||||
// go/keep-sorted end
|
||||
// go/keep-sorted start
|
||||
@use './internal/values';
|
||||
@use './internal/validate';
|
||||
@use './md-ref-typeface';
|
||||
@use './v0_192/md-sys-typescale';
|
||||
// go/keep-sorted end
|
||||
@ -141,7 +141,7 @@ $_default: (
|
||||
}
|
||||
}
|
||||
|
||||
@return values.validate(
|
||||
@return validate.values(
|
||||
$tokens,
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
|
@ -14,7 +14,7 @@
|
||||
/// Validation requires a `$values` Map and at least the `$supported-tokens`
|
||||
/// keyword argument.
|
||||
/// @example - scss
|
||||
/// $tokens: values.validate(
|
||||
/// $tokens: validate.values(
|
||||
/// md-comp-foo.values($deps, $exclude-hardcoded-values),
|
||||
/// $supported-tokens: (),
|
||||
/// 'foo-color',
|
||||
@ -39,18 +39,18 @@
|
||||
/// `$supported-tokens` list.
|
||||
/// @return {Map} The `tokens.md-comp-*-values()` Map with any unsupported
|
||||
/// tokens removed, renamed tokens updated, and new tokens added.
|
||||
@function validate($values, $tokens...) {
|
||||
@function values($values, $tokens...) {
|
||||
$tokens: meta.keywords($tokens);
|
||||
|
||||
$renamed-tokens: map.get($tokens, 'renamed-tokens');
|
||||
@if $renamed-tokens {
|
||||
@if meta.type-of($renamed-tokens) != 'map' {
|
||||
@error 'values.validate($renamed-tokens) must be a map.';
|
||||
@error 'validate.values($renamed-tokens) must be a map.';
|
||||
}
|
||||
|
||||
@each $old-token, $new-token in $renamed-tokens {
|
||||
@if not map.has-key($values, $old-token) {
|
||||
@error 'values.validate($renamed-tokens: (\'#{$old-token}\': \'#{$new-token}\')) old-token in not the provided values.';
|
||||
@error 'validate.values($renamed-tokens: (\'#{$old-token}\': \'#{$new-token}\')) old-token in not the provided values.';
|
||||
}
|
||||
|
||||
$values: map.set($values, $new-token, map.get($values, $old-token));
|
||||
@ -61,12 +61,12 @@
|
||||
$unsupported-tokens: map.get($tokens, 'unsupported-tokens');
|
||||
@if $unsupported-tokens {
|
||||
@if meta.type-of($unsupported-tokens) != 'list' {
|
||||
@error 'values.validate($unsupported-tokens) must be a list.';
|
||||
@error 'validate.values($unsupported-tokens) must be a list.';
|
||||
}
|
||||
|
||||
@each $unsupported-token in $unsupported-tokens {
|
||||
@if not map.has-key($values, $unsupported-token) {
|
||||
@error 'values.validate($unsupported-tokens: (\'#{$unsupported-token}\')) token is not in the provided values.';
|
||||
@error 'validate.values($unsupported-tokens: (\'#{$unsupported-token}\')) token is not in the provided values.';
|
||||
}
|
||||
|
||||
$values: map.remove($values, $unsupported-token);
|
||||
@ -76,12 +76,12 @@
|
||||
$new-tokens: map.get($tokens, 'new-tokens');
|
||||
@if $new-tokens {
|
||||
@if meta.type-of($new-tokens) != 'map' {
|
||||
@error 'values.validate($new-tokens) must be a map.';
|
||||
@error 'validate.values($new-tokens) must be a map.';
|
||||
}
|
||||
|
||||
@each $new-token, $new-value in $new-tokens {
|
||||
@if map.has-key($values, $new-token) {
|
||||
@warn 'values.validate($new-tokens: (\'#{$new-token}\': \'#{$new-value}\')) already exists. Has it been added to tokens? If so, remove this new token.';
|
||||
@warn 'validate.values($new-tokens: (\'#{$new-token}\': \'#{$new-value}\')) already exists. Has it been added to tokens? If so, remove this new token.';
|
||||
}
|
||||
|
||||
$values: map.set($values, $new-token, $new-value);
|
||||
@ -90,12 +90,12 @@
|
||||
|
||||
$supported-tokens: map.get($tokens, 'supported-tokens');
|
||||
@if not $supported-tokens or meta.type-of($supported-tokens) != 'list' {
|
||||
@error 'values.validate() must include a $supported-tokens list.';
|
||||
@error 'validate.values() must include a $supported-tokens list.';
|
||||
}
|
||||
|
||||
@each $token in map.keys($values) {
|
||||
@if list.index($supported-tokens, $token) == null {
|
||||
@error 'values.validate($supported-tokens)) is missing the \'#{$token}\' token. Does it need adding to $unsupported-tokens?';
|
||||
@error 'validate.values($supported-tokens)) is missing the \'#{$token}\' token. Does it need adding to $unsupported-tokens?';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user