Skip to content

Commit

Permalink
feat(plasma-web/b2c,sdds-serv): update Textfield configs
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanKuzmich committed Jul 5, 2024
1 parent 64e26ae commit 7992cca
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 90 deletions.
42 changes: 11 additions & 31 deletions packages/plasma-b2c/src/components/TextField/TextField.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
css,
textFieldTokens as tokens,
textField_labelPlacement_inner as labelPlacement_inner,
textField_labelPlacement_outer as labelPlacement_outer,
} from '@salutejs/plasma-new-hope/styled-components';
import { css, textFieldTokens as tokens } from '@salutejs/plasma-new-hope/styled-components';

export const config = {
defaults: {
Expand Down Expand Up @@ -40,7 +35,6 @@ export const config = {
${tokens.focusColor}: var(--text-accent);
`,
// TODO заменить --surface-transparent-positive на корректный токен
positive: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-positive);
Expand Down Expand Up @@ -68,7 +62,6 @@ export const config = {
${tokens.textBeforeColor}: var(--text-tertiary);
${tokens.textAfterColor}: var(--text-tertiary);
`,
// // TODO заменить --surface-transparent-warning на корректный токен
warning: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-warning);
Expand Down Expand Up @@ -96,7 +89,6 @@ export const config = {
${tokens.focusColor}: var(--text-accent);
`,
// // TODO заменить --surface-transparent-negative на корректный токен
negative: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-negative);
Expand Down Expand Up @@ -340,34 +332,22 @@ export const config = {
`,
},
labelPlacement: {
inner: [
labelPlacement_inner,
css`
&.${labelPlacement_inner} {
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
}
`,
],
outer: [
labelPlacement_outer,
css`
&.${labelPlacement_outer} {
}
`,
],
inner: css`
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
`,
outer: css``,
},
disabled: {
true: css`
${tokens.disabledOpacity}: 0.4;
`,
},
// TODO заменить --surface-transparent-primary на корректный токен
readOnly: {
true: css`
${tokens.colorReadOnly}: var(--text-secondary);
Expand Down
39 changes: 11 additions & 28 deletions packages/plasma-web/src/components/TextField/TextField.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
css,
textFieldTokens as tokens,
textField_labelPlacement_inner as labelPlacement_inner,
textField_labelPlacement_outer as labelPlacement_outer,
} from '@salutejs/plasma-new-hope/styled-components';
import { css, textFieldTokens as tokens } from '@salutejs/plasma-new-hope/styled-components';

export const config = {
defaults: {
Expand Down Expand Up @@ -353,34 +348,22 @@ export const config = {
`,
},
labelPlacement: {
inner: [
labelPlacement_inner,
css`
&.${labelPlacement_inner} {
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
}
`,
],
outer: [
labelPlacement_outer,
css`
&.${labelPlacement_outer} {
}
`,
],
inner: css`
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
`,
outer: css``,
},
disabled: {
true: css`
${tokens.disabledOpacity}: 0.4;
`,
},
// TODO заменить --surface-transparent-primary на корректный токен
readOnly: {
true: css`
${tokens.colorReadOnly}: var(--text-primary);
Expand Down
42 changes: 11 additions & 31 deletions packages/sdds-serv/src/components/TextField/TextField.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
css,
textFieldTokens as tokens,
textField_labelPlacement_inner as labelPlacement_inner,
textField_labelPlacement_outer as labelPlacement_outer,
} from '@salutejs/plasma-new-hope/styled-components';
import { css, textFieldTokens as tokens } from '@salutejs/plasma-new-hope/styled-components';

export const config = {
defaults: {
Expand Down Expand Up @@ -40,7 +35,6 @@ export const config = {
${tokens.focusColor}: var(--text-accent);
`,
// TODO заменить --surface-transparent-positive на корректный токен
positive: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-positive);
Expand Down Expand Up @@ -68,7 +62,6 @@ export const config = {
${tokens.focusColor}: var(--text-accent);
`,
// // TODO заменить --surface-transparent-warning на корректный токен
warning: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-warning);
Expand Down Expand Up @@ -96,7 +89,6 @@ export const config = {
${tokens.focusColor}: var(--text-accent);
`,
// // TODO заменить --surface-transparent-negative на корректный токен
negative: css`
${tokens.color}: var(--plasma-colors-primary);
${tokens.backgroundColor}: var(--surface-transparent-negative);
Expand Down Expand Up @@ -340,34 +332,22 @@ export const config = {
`,
},
labelPlacement: {
inner: [
labelPlacement_inner,
css`
&.${labelPlacement_inner} {
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
}
`,
],
outer: [
labelPlacement_outer,
css`
&.${labelPlacement_outer} {
}
`,
],
inner: css`
${tokens.placeholderColor}: var(--plasma-input-label-color, var(--plasma-input-placeholder-color, var(--plasma-colors-secondary)));
${tokens.labelInnerFontFamily}: var(--plasma-typo-body-xs-font-family);
${tokens.labelInnerFontSize}: var(--plasma-typo-body-xs-font-size);
${tokens.labelInnerFontStyle}: var(--plasma-typo-body-xs-font-style);
${tokens.labelInnerFontWeight}: var(--plasma-typo-body-xs-font-weight);
${tokens.labelInnerLetterSpacing}: var(--plasma-typo-body-xs-letter-spacing);
${tokens.labelInnerLineHeight}: var(--plasma-typo-body-xs-line-height);
`,
outer: css``,
},
disabled: {
true: css`
${tokens.disabledOpacity}: 0.4;
`,
},
// TODO заменить --surface-transparent-primary на корректный токен
readOnly: {
true: css`
${tokens.colorReadOnly}: var(--text-secondary);
Expand Down

0 comments on commit 7992cca

Please sign in to comment.