-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Timeline] Migrate TimelineOppositeContent to emotion #25816
Merged
mnajdova
merged 6 commits into
mui:next
from
vicasas:feature/migrate-timeline-opposite-demo-to-emotion
Apr 19, 2021
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c70bd04
Migrate to emotion
vicasas 63a6044
Migrate to emotion
vicasas 5a59e30
no blank lines
oliviertassinari 90a44f2
Update packages/material-ui-lab/TimelineOppositeContent/TimelineOppos…
vicasas 4457843
Merge branch 'feature/migrate-timeline-opposite-demo-to-emotion' of h…
vicasas 21ea343
Update docs/pages/api-docs/timeline-opposite-content.json
vicasas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
30 changes: 21 additions & 9 deletions
30
packages/material-ui-lab/src/TimelineOppositeContent/TimelineOppositeContent.test.js
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 |
---|---|---|
@@ -1,21 +1,33 @@ | ||
import * as React from 'react'; | ||
import { getClasses, createMount, describeConformance } from 'test/utils'; | ||
import { expect } from 'chai'; | ||
import { createClientRender, createMount, describeConformanceV5 } from 'test/utils'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import TimelineOppositeContent from './TimelineOppositeContent'; | ||
import Timeline from '@material-ui/lab/Timeline'; | ||
import TimelineOppositeContent, { | ||
timelineOppositeContentClasses as classes, | ||
} from '@material-ui/lab/TimelineOppositeContent'; | ||
|
||
describe('<TimelineOppositeContent />', () => { | ||
const render = createClientRender(); | ||
const mount = createMount(); | ||
let classes; | ||
|
||
before(() => { | ||
classes = getClasses(<TimelineOppositeContent />); | ||
}); | ||
|
||
describeConformance(<TimelineOppositeContent />, () => ({ | ||
describeConformanceV5(<TimelineOppositeContent />, () => ({ | ||
classes, | ||
inheritComponent: Typography, | ||
render, | ||
mount, | ||
muiName: 'MuiTimelineOppositeContent', | ||
refInstanceof: window.HTMLDivElement, | ||
skip: ['componentProp'], | ||
skip: ['componentProp', 'componentsProp', 'themeVariants'], | ||
})); | ||
|
||
it('when align right should have alignRight class', () => { | ||
const { getByText } = render( | ||
<Timeline align="right"> | ||
<TimelineOppositeContent>content</TimelineOppositeContent> | ||
</Timeline>, | ||
); | ||
|
||
expect(getByText('content')).to.have.class(classes.alignRight); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/material-ui-lab/src/TimelineOppositeContent/TimelineOppositeContentClasses.d.ts
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,9 @@ | ||
import { TimelineOppositeContentClassKey } from './TimelineOppositeContent'; | ||
|
||
export type TimelineOppositeContentClasses = Record<TimelineOppositeContentClassKey, string>; | ||
|
||
declare const timelineOppositeContentClasses: TimelineOppositeContentClasses; | ||
|
||
export function getTimelineOppositeContentUtilityClass(slot: string): string; | ||
|
||
export default timelineOppositeContentClasses; |
3 changes: 3 additions & 0 deletions
3
packages/material-ui-lab/src/TimelineOppositeContent/index.d.ts
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export { default } from './TimelineOppositeContent'; | ||
export * from './TimelineOppositeContent'; | ||
|
||
export { default as timelineOppositeContentClasses } from './timelineOppositeContentClasses'; | ||
export * from './timelineOppositeContentClasses'; |
3 changes: 3 additions & 0 deletions
3
packages/material-ui-lab/src/TimelineOppositeContent/index.js
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
export { default } from './TimelineOppositeContent'; | ||
|
||
export { default as timelineOppositeContentClasses } from './timelineOppositeContentClasses'; | ||
export * from './timelineOppositeContentClasses'; |
14 changes: 14 additions & 0 deletions
14
packages/material-ui-lab/src/TimelineOppositeContent/timelineOppositeContentClasses.js
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,14 @@ | ||
import { generateUtilityClass, generateUtilityClasses } from '@material-ui/unstyled'; | ||
|
||
export function getTimelineOppositeContentUtilityClass(slot) { | ||
return generateUtilityClass('MuiTimelineOppositeContent', slot); | ||
} | ||
|
||
const timelineOppositeContentClasses = generateUtilityClasses('MuiTimelineOppositeContent', [ | ||
'root', | ||
'alignLeft', | ||
'alignRight', | ||
'alignAlternate', | ||
vicasas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
]); | ||
|
||
export default timelineOppositeContentClasses; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't be needing this after #25822 (review) No preference on the other of how there are merged as long as we release them all at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this one and we can actually do the update in #25822 (review)