Skip to content

Commit a8993ef

Browse files
committed
fix(themes): rename text related color variables
'text' remamed to 'materialText', 'inputText' renamed to 'canvasText' BREAKING CHANGE: 'text' remamed to 'materialText', 'inputText' renamed to 'canvasText
1 parent 2b0662b commit a8993ef

File tree

22 files changed

+336
-326
lines changed

22 files changed

+336
-326
lines changed

src/components/Button/Button.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ describe('<Button />', () => {
4343
<Button {...defaultProps} disabled />
4444
);
4545
const button = getByRole('button');
46-
const disabledTextShadow = `1px 1px ${theme.textDisabledShadow}`;
46+
const disabledTextShadow = `1px 1px ${theme.materialTextDisabledShadow}`;
4747

48-
expect(button).toHaveStyleRule('color', theme.textDisabled);
48+
expect(button).toHaveStyleRule('color', theme.materialTextDisabled);
4949
expect(button).toHaveStyleRule('text-shadow', disabledTextShadow);
5050

5151
rerender(<Button {...defaultProps} variant='menu' />);
52-
expect(button).toHaveStyleRule('color', theme.textDisabled);
52+
expect(button).toHaveStyleRule('color', theme.materialTextDisabled);
5353
expect(button).toHaveStyleRule('text-shadow', disabledTextShadow);
5454

5555
rerender(<Button {...defaultProps} variant='flat' />);
56-
expect(button).toHaveStyleRule('color', theme.textDisabled);
56+
expect(button).toHaveStyleRule('color', theme.materialTextDisabled);
5757
expect(button).toHaveStyleRule('text-shadow', disabledTextShadow);
5858
});
5959

src/components/Checkbox/Checkbox.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ const CheckmarkIcon = styled.span.attrs(() => ({
8686
${({ variant, theme, isDisabled }) =>
8787
variant === 'menu'
8888
? css`
89-
border-color: ${isDisabled ? theme.textDisabled : theme.text};
89+
border-color: ${isDisabled
90+
? theme.materialTextDisabled
91+
: theme.materialText};
9092
filter: drop-shadow(
9193
1px 1px 0px
92-
${isDisabled ? theme.textDisabledShadow : 'transparent'}
94+
${isDisabled ? theme.materialTextDisabledShadow : 'transparent'}
9395
);
9496
`
9597
: css`
@@ -102,7 +104,7 @@ const CheckmarkIcon = styled.span.attrs(() => ({
102104
!isDisabled &&
103105
variant === 'menu' &&
104106
css`
105-
border-color: ${theme.textInvert};
107+
border-color: ${theme.materialTextInvert};
106108
`};
107109
}
108110
`;
@@ -140,11 +142,12 @@ const IndeterminateIcon = styled.span.attrs(() => ({
140142
css`
141143
${StyledListItem}:hover & {
142144
${createHatchedBackground({
143-
mainColor: theme.textInvert
145+
mainColor: theme.materialTextInvert
144146
})}
145147
}
146148
filter: drop-shadow(
147-
1px 1px 0px ${isDisabled ? theme.textDisabledShadow : 'transparent'}
149+
1px 1px 0px
150+
${isDisabled ? theme.materialTextDisabledShadow : 'transparent'}
148151
);
149152
`};
150153
}

src/components/ColorInput/ColorInput.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ const ColorPreview = styled.div`
4545
${({ isDisabled }) =>
4646
isDisabled
4747
? css`
48-
border: 2px solid ${({ theme }) => theme.textDisabled};
48+
border: 2px solid ${({ theme }) => theme.materialTextDisabled};
4949
filter: drop-shadow(
50-
1px 1px 0px ${({ theme }) => theme.textDisabledShadow}
50+
1px 1px 0px ${({ theme }) => theme.materialTextDisabledShadow}
5151
);
5252
`
5353
: css`
54-
border: 2px solid ${({ theme }) => theme.text};
54+
border: 2px solid ${({ theme }) => theme.materialText};
5555
`}
5656
${StyledColorInput}:focus:not(:active) + &:after {
5757
content: '';
@@ -76,13 +76,13 @@ const ChevronIcon = styled.span`
7676
${({ isDisabled }) =>
7777
isDisabled
7878
? css`
79-
border-top: 6px solid ${({ theme }) => theme.textDisabled};
79+
border-top: 6px solid ${({ theme }) => theme.materialTextDisabled};
8080
filter: drop-shadow(
81-
1px 1px 0px ${({ theme }) => theme.textDisabledShadow}
81+
1px 1px 0px ${({ theme }) => theme.materialTextDisabledShadow}
8282
);
8383
`
8484
: css`
85-
border-top: 6px solid ${({ theme }) => theme.text};
85+
border-top: 6px solid ${({ theme }) => theme.materialText};
8686
`}
8787
&:after {
8888
content: '';

src/components/DatePicker/DatePicker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const DateItemContent = styled.span`
4141
4242
background: ${({ active, theme }) =>
4343
active ? theme.hoverBackground : 'transparent'};
44-
color: ${({ active, theme }) => (active ? theme.textInvert : 'initial')};
44+
color: ${({ active, theme }) =>
45+
active ? theme.canvasTextInvert : theme.canvasText};
4546
4647
&:hover {
4748
border: 2px dashed

src/components/Fieldset/Fieldset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const StyledFieldset = styled.fieldset`
1212
padding: 16px;
1313
margin-top: 8px;
1414
font-size: 1rem;
15-
color: ${({ theme }) => theme.text};
15+
color: ${({ theme }) => theme.materialText};
1616
${({ variant }) =>
1717
variant !== 'flat' &&
1818
css`

src/components/Fieldset/Fieldset.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ describe('<Fieldset />', () => {
4343

4444
expect(fieldset).toHaveAttribute('aria-disabled', 'true');
4545

46-
expect(fieldset).toHaveStyleRule('color', theme.textDisabled);
46+
expect(fieldset).toHaveStyleRule('color', theme.materialTextDisabled);
4747
expect(fieldset).toHaveStyleRule(
4848
'text-shadow',
49-
`1px 1px ${theme.textDisabledShadow}`
49+
`1px 1px ${theme.materialTextDisabledShadow}`
5050
);
5151
});
5252
});

src/components/ListItem/ListItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export const StyledListItem = styled.li`
2020
props.square ? 'space-around' : 'space-between'};
2121
text-align: center;
2222
line-height: ${props => blockSizes[props.size]};
23-
color: ${({ theme }) => theme.text};
23+
color: ${({ theme }) => theme.materialText};
2424
pointer-events: ${({ isDisabled }) => (isDisabled ? 'none' : 'auto')};
2525
2626
&:hover {
2727
${({ theme, isDisabled }) =>
2828
!isDisabled &&
2929
`
30-
color: ${theme.textInvert};
30+
color: ${theme.materialTextInvert};
3131
background: ${theme.hoverBackground};
3232
`}
3333

src/components/ListItem/ListItem.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ describe('<ListItem />', () => {
5454
const { container } = renderWithTheme(<ListItem disabled />);
5555
const listItem = container.firstChild;
5656
expect(listItem).toHaveStyleRule('pointer-events', 'none');
57-
expect(listItem).toHaveStyleRule('color', theme.textDisabled);
57+
expect(listItem).toHaveStyleRule('color', theme.materialTextDisabled);
5858
expect(listItem).toHaveStyleRule(
5959
'text-shadow',
60-
`1px 1px ${theme.textDisabledShadow}`
60+
`1px 1px ${theme.materialTextDisabledShadow}`
6161
);
6262
});
6363
});

src/components/NumberField/NumberField.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,24 @@ const StyledButtonIcon = styled.span`
6262
? css`
6363
border-left: 4px solid transparent;
6464
border-right: 4px solid transparent;
65-
border-bottom: 4px solid ${({ theme }) => theme.text};
65+
border-bottom: 4px solid ${({ theme }) => theme.materialText};
6666
`
6767
: css`
6868
border-left: 4px solid transparent;
6969
border-right: 4px solid transparent;
70-
border-top: 4px solid ${({ theme }) => theme.text};
70+
border-top: 4px solid ${({ theme }) => theme.materialText};
7171
`}
7272
${StyledButton}:disabled & {
73-
filter: drop-shadow(1px 1px 0px ${({ theme }) => theme.textDisabledShadow});
73+
filter: drop-shadow(
74+
1px 1px 0px ${({ theme }) => theme.materialTextDisabledShadow}
75+
);
7476
${({ invert }) =>
7577
invert
7678
? css`
77-
border-bottom-color: ${({ theme }) => theme.textDisabled};
79+
border-bottom-color: ${({ theme }) => theme.materialTextDisabled};
7880
`
7981
: css`
80-
border-top-color: ${({ theme }) => theme.textDisabled};
82+
border-top-color: ${({ theme }) => theme.materialTextDisabled};
8183
`}
8284
}
8385
`;

src/components/Progress/Progress.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const WhiteBar = styled.div`
2828
color: #000;
2929
margin-left: 2px;
3030
margin-top: -2px;
31-
color: ${({ theme }) => theme.text};
31+
color: ${({ theme }) => theme.materialText};
3232
`;
3333

3434
const BlueBar = styled.div`
@@ -41,7 +41,7 @@ const BlueBar = styled.div`
4141
4242
line-height: ${blockSizes.md};
4343
44-
color: ${({ theme }) => theme.textInvert};
44+
color: ${({ theme }) => theme.materialTextInvert};
4545
background: ${({ theme }) => theme.progress};
4646
clip-path: polygon(
4747
0 0,

0 commit comments

Comments
 (0)