-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Card] Migrate CardActionArea to emotion (#24636)
- Loading branch information
Showing
9 changed files
with
130 additions
and
49 deletions.
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
15 changes: 7 additions & 8 deletions
15
packages/material-ui/src/CardActionArea/CardActionArea.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,20 @@ | ||
import * as React from 'react'; | ||
import { getClasses, createMount, describeConformance } from 'test/utils'; | ||
import { createMount, describeConformanceV5 } from 'test/utils'; | ||
import ButtonBase from '../ButtonBase'; | ||
import CardActionArea from './CardActionArea'; | ||
import classes from './cardActionAreaClasses'; | ||
|
||
describe('<CardActionArea />', () => { | ||
const mount = createMount(); | ||
let classes; | ||
|
||
before(() => { | ||
classes = getClasses(<CardActionArea />); | ||
}); | ||
|
||
describeConformance(<CardActionArea />, () => ({ | ||
describeConformanceV5(<CardActionArea />, () => ({ | ||
classes, | ||
inheritComponent: ButtonBase, | ||
mount, | ||
muiName: 'MuiCardActionArea', | ||
testDeepOverrides: { slotName: 'focusHighlight', slotClassName: classes.focusHighlight }, | ||
testVariantProps: { variant: 'foo' }, | ||
refInstanceof: window.HTMLButtonElement, | ||
skip: ['componentProp'], | ||
skip: ['componentProp', 'componentsProp'], | ||
})); | ||
}); |
11 changes: 11 additions & 0 deletions
11
packages/material-ui/src/CardActionArea/cardActionAreaClasses.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,11 @@ | ||
export interface CardActionAreaClasses { | ||
root: string; | ||
focusVisible: string; | ||
focusHighlight: string; | ||
} | ||
|
||
declare const cardActionAreaClasses: CardActionAreaClasses; | ||
|
||
export function getCardActionAreaUtilityClass(slot: string): string; | ||
|
||
export default cardActionAreaClasses; |
13 changes: 13 additions & 0 deletions
13
packages/material-ui/src/CardActionArea/cardActionAreaClasses.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,13 @@ | ||
import { generateUtilityClass, generateUtilityClasses } from '@material-ui/unstyled'; | ||
|
||
export function getCardActionAreaUtilityClass(slot) { | ||
return generateUtilityClass('MuiCardActionArea', slot); | ||
} | ||
|
||
const cardActionAreaClasses = generateUtilityClasses('MuiCardActionArea', [ | ||
'root', | ||
'focusVisible', | ||
'focusHighlight', | ||
]); | ||
|
||
export default cardActionAreaClasses; |
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 './CardActionArea'; | ||
export * from './CardActionArea'; | ||
|
||
export { default as cardActionAreaClasses } from './cardActionAreaClasses'; | ||
export * from './cardActionAreaClasses'; |
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 './CardActionArea'; | ||
|
||
export { default as cardActionAreaClasses } from './cardActionAreaClasses'; | ||
export * from './cardActionAreaClasses'; |