Skip to content

Commit 2c72fa1

Browse files
authored
Merge pull request #910 from hasparus/simplify-types
Simplify types and fix minor bugs
2 parents 3b6aafb + 5b7f14c commit 2c72fa1

File tree

45 files changed

+252
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+252
-200
lines changed

examples/codesandbox-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@emotion/core": "^10.0.17",
1313
"@mdx-js/react": "^1.4.5",
14-
"@theme-ui/presets": "^0.4.0-alpha.2",
14+
"@theme-ui/presets": "^0.4.0-alpha.3",
1515
"react": "^16.12.0",
1616
"react-dom": "^16.9.0",
1717
"theme-ui": "^0.4.0-alpha.3"

packages/chrome/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"webpack-cli": "^3.3.4"
3333
},
3434
"devDependencies": {
35-
"@theme-ui/css": "^0.4.0-alpha.2"
35+
"@theme-ui/css": "^0.4.0-alpha.3"
3636
},
3737
"gitHead": "bfd026cae085f377ca537de897dc43233d50f5d5"
3838
}

packages/color-modes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@emotion/core": "^10.0.0",
1919
"@theme-ui/core": "^0.4.0-alpha.3",
20-
"@theme-ui/css": "^0.4.0-alpha.2",
20+
"@theme-ui/css": "^0.4.0-alpha.3",
2121
"deepmerge": "^4.2.2"
2222
},
2323
"peerDependencies": {

packages/color/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@theme-ui/color",
3-
"version": "0.4.0-alpha.2",
3+
"version": "0.4.0-alpha.3",
44
"source": "src/index.ts",
55
"main": "dist/index.js",
66
"module": "dist/index.esm.js",
@@ -10,7 +10,7 @@
1010
"watch": "microbundle watch --no-compress"
1111
},
1212
"dependencies": {
13-
"@theme-ui/css": "^0.4.0-alpha.2",
13+
"@theme-ui/css": "^0.4.0-alpha.3",
1414
"polished": "^3.4.1"
1515
},
1616
"publishConfig": {

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@styled-system/color": "^5.1.2",
1717
"@styled-system/should-forward-prop": "^5.1.2",
1818
"@styled-system/space": "^5.1.2",
19-
"@theme-ui/css": "^0.4.0-alpha.2"
19+
"@theme-ui/css": "^0.4.0-alpha.3"
2020
},
2121
"peerDependencies": {
2222
"react": "^16.8.0"

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@emotion/core": "^10.0.0",
21-
"@theme-ui/css": "^0.4.0-alpha.2",
21+
"@theme-ui/css": "^0.4.0-alpha.3",
2222
"deepmerge": "^4.2.2"
2323
},
2424
"peerDependencies": {

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const BaseProvider: React.FC<BaseProviderProps> = ({ context, children }) =>
8989
)
9090

9191
export interface ThemeProviderProps {
92-
theme: Partial<Theme> | ((outerTheme: Theme) => Theme)
92+
theme: Theme | ((outerTheme: Theme) => Theme)
9393
children?: React.ReactNode
9494
}
9595

packages/core/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { SystemStyleObject } from '@theme-ui/css'
1+
import { ThemeUIStyleObject } from '@theme-ui/css'
22

33
/**
44
* The `sx` prop accepts a `SxStyleProp` object and properties that are part of
55
* the `Theme` will be transformed to their corresponding values. Other valid
66
* CSS properties are also allowed.
77
*/
8-
export type SxStyleProp = SystemStyleObject
8+
export type SxStyleProp = ThemeUIStyleObject
99

1010
export interface SxProps {
1111
/**

packages/css/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@theme-ui/css",
3-
"version": "0.4.0-alpha.2",
3+
"version": "0.4.0-alpha.3",
44
"source": "src/index.ts",
55
"main": "dist/index.js",
66
"module": "dist/index.esm.js",

packages/css/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSObject, SystemStyleObject, UseThemeFunction, Theme } from './types'
1+
import { CSSObject, ThemeUIStyleObject, UseThemeFunction, Theme } from './types'
22

33
export * from './types'
44

@@ -215,10 +215,10 @@ const transforms = [
215215
{}
216216
)
217217

218-
const responsive = (styles: Exclude<SystemStyleObject, UseThemeFunction>) => (
218+
const responsive = (styles: Exclude<ThemeUIStyleObject, UseThemeFunction>) => (
219219
theme?: Theme
220220
) => {
221-
const next: Exclude<SystemStyleObject, UseThemeFunction> = {}
221+
const next: Exclude<ThemeUIStyleObject, UseThemeFunction> = {}
222222
const breakpoints =
223223
(theme && (theme.breakpoints as string[])) || defaultBreakpoints
224224
const mediaQueries = [
@@ -252,7 +252,7 @@ const responsive = (styles: Exclude<SystemStyleObject, UseThemeFunction>) => (
252252

253253
type CssPropsArgument = { theme: Theme } | Theme
254254

255-
export const css = (args: SystemStyleObject = {}) => (
255+
export const css = (args: ThemeUIStyleObject = {}) => (
256256
props: CssPropsArgument = {}
257257
): CSSObject => {
258258
const theme: Theme = {

0 commit comments

Comments
 (0)