-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeScript] Fix
sx
types and missing style
prop from layout comp…
…onents (#191)
- Loading branch information
1 parent
69a550a
commit 4576df1
Showing
13 changed files
with
71 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import type { CSSObjectNoCallback } from './base'; | ||
import type { ThemeArgs } from './theme'; | ||
|
||
export type SxProp = CSSObjectNoCallback | ((themeArgs: ThemeArgs) => CSSObjectNoCallback); | ||
export type SxProp = | ||
| CSSObjectNoCallback | ||
| ((themeArgs: ThemeArgs['theme']) => CSSObjectNoCallback) | ||
| ReadonlyArray<CSSObjectNoCallback | ((themeArgs: ThemeArgs['theme']) => CSSObjectNoCallback)>; | ||
|
||
export default function sx(arg: SxProp | Array<SxProp>, componentClass?: string): string; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as React from 'react'; | ||
import Container from '../src/Container'; | ||
|
||
<Container maxWidth="md" />; | ||
|
||
<Container | ||
className="" | ||
style={{ accentColor: 'ActiveBorder', marginTop: '1rem' }} | ||
data-testid="foo" | ||
/>; |
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 * as React from 'react'; | ||
import Grid from '../src/Grid'; | ||
|
||
<Grid size={{ xs: 2, md: 3, lg: 4 }} />; | ||
|
||
<Grid className="" style={{ accentColor: 'ActiveBorder', marginTop: '1rem' }} data-testid="foo" />; |
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,10 @@ | ||
import * as React from 'react'; | ||
import Hidden from '../src/Hidden'; | ||
|
||
<Hidden xsUp mdDown />; | ||
|
||
<Hidden | ||
className="" | ||
style={{ accentColor: 'ActiveBorder', marginTop: '1rem' }} | ||
data-testid="foo" | ||
/>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { SxProp } from '../src/sx'; | ||
|
||
const sx1: SxProp = { color: 'red' }; | ||
|
||
const sx2: SxProp = (theme) => ({ | ||
color: theme.palette.primary.main, | ||
}); | ||
|
||
const sx3: SxProp = [{ color: 'red' }, { backgroundColor: 'blue', color: 'white' }]; | ||
|
||
const test = true; | ||
const sx4: SxProp = [ | ||
test ? { color: 'red' } : { backgroundColor: 'blue', color: 'white' }, | ||
(theme) => ({ | ||
border: `1px solid ${theme.palette.primary.main}`, | ||
}), | ||
]; |