-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace themeGet for getSemanticValue
- Loading branch information
Martí Malek
committed
Jan 26, 2024
1 parent
d7770fe
commit 05d3b54
Showing
10 changed files
with
336 additions
and
221 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
src/codemods/__testfixtures__/semantic-colors-to-new-theme/color-in-single-quasis.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Headline, SemanticColors } from '@freenow/wave' | ||
import styled from 'styled-components' | ||
|
||
export const DetailsHeadline = styled(Headline).attrs({ as: 'h3', size: 'm' })` | ||
color: ${SemanticColors.text.secondary}; | ||
` |
6 changes: 6 additions & 0 deletions
6
src/codemods/__testfixtures__/semantic-colors-to-new-theme/color-in-single-quasis.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Headline, getSemanticValue } from '@freenow/wave' | ||
import styled from 'styled-components' | ||
|
||
export const DetailsHeadline = styled(Headline).attrs({ as: 'h3', size: 'm' })` | ||
color: ${getSemanticValue('foreground-neutral-emphasized')}; | ||
` |
20 changes: 20 additions & 0 deletions
20
src/codemods/__testfixtures__/semantic-colors-to-new-theme/no-colors-usage.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Box, ChevronUp } from '@freenow/wave'; | ||
import { useEffect } from 'react'; | ||
|
||
export const AlignedChevron = () => { | ||
useEffect( | ||
() => | ||
function cleanUp() { | ||
// when parsing back from AST to source, function declarations after an arrow function | ||
// are wrapped in parenthesis, by expecting the output to not have the parenthesis we | ||
// can test that instead of parsing back we are simply returning the original source | ||
}, | ||
[], | ||
) | ||
|
||
return ( | ||
<Box display="flex" alignItems="center"> | ||
<ChevronUp color="red" /> | ||
</Box> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/codemods/__testfixtures__/semantic-colors-to-new-theme/no-colors-usage.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Box, ChevronUp } from '@freenow/wave'; | ||
import { useEffect } from 'react'; | ||
|
||
export const AlignedChevron = () => { | ||
useEffect( | ||
() => | ||
function cleanUp() { | ||
// when parsing back from AST to source, function declarations after an arrow function | ||
// are wrapped in parenthesis, by expecting the output to not have the parenthesis we | ||
// can test that instead of parsing back we are simply returning the original source | ||
}, | ||
[], | ||
) | ||
|
||
return ( | ||
<Box display="flex" alignItems="center"> | ||
<ChevronUp color="red" /> | ||
</Box> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
src/codemods/__testfixtures__/semantic-colors-to-new-theme/theme-get-in-JSX.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { CloseIcon, themeGet } from '@freenow/wave'; | ||
|
||
export const CloseIconWrapper = () => ( | ||
<CloseIcon data-testid="dismissBanner" color={themeGet('semanticColors.text.primary')} cursor="pointer" size={18} /> | ||
); |
5 changes: 5 additions & 0 deletions
5
src/codemods/__testfixtures__/semantic-colors-to-new-theme/theme-get-in-JSX.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { CloseIcon, getSemanticValue } from '@freenow/wave'; | ||
|
||
export const CloseIconWrapper = () => ( | ||
<CloseIcon data-testid="dismissBanner" color={getSemanticValue('foreground-primary')} cursor="pointer" size={18} /> | ||
); |
6 changes: 6 additions & 0 deletions
6
...ods/__testfixtures__/semantic-colors-to-new-theme/theme-get-in-template-literal.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Text, themeGet } from '@freenow/wave' | ||
import styled from 'styled-components' | ||
|
||
export const TextSizeText = styled(Text)` | ||
color: ${themeGet('semanticColors.text.primary')}; | ||
` |
6 changes: 6 additions & 0 deletions
6
...ds/__testfixtures__/semantic-colors-to-new-theme/theme-get-in-template-literal.output.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Text, getSemanticValue } from '@freenow/wave' | ||
import styled from 'styled-components' | ||
|
||
export const TextSizeText = styled(Text)` | ||
color: ${getSemanticValue('foreground-primary')}; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.