Skip to content

Commit 77d5216

Browse files
committed
Rename SystemStyleObject to ThemeUIStyleObject
1 parent 607547e commit 77d5216

File tree

35 files changed

+117
-114
lines changed

35 files changed

+117
-114
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/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 = {

packages/css/src/types.ts

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface CSSProperties
2727
/**
2828
* Map of all CSS pseudo selectors (`:hover`, `:focus`, ...)
2929
*/
30-
export type CSSPseudoSelectorProps = { [K in CSS.Pseudos]?: SystemStyleObject }
30+
export type CSSPseudoSelectorProps = { [K in CSS.Pseudos]?: ThemeUIStyleObject }
3131

3232
/**
3333
* CSS as POJO that is compatible with CSS-in-JS libaries.
@@ -51,7 +51,7 @@ interface CSSOthersObjectForCSSObject {
5151
* Map all nested selectors
5252
*/
5353
export interface CSSSelectorObject {
54-
[cssSelector: string]: SystemStyleObject
54+
[cssSelector: string]: ThemeUIStyleObject
5555
}
5656

5757
interface AliasesCSSProperties {
@@ -427,20 +427,19 @@ interface OverwriteCSSProperties {
427427
}
428428

429429
/**
430-
* Map of all available CSS properties (including aliases) and their raw value.
431-
* Only used internally to map CCS properties to input types (responsive value,
432-
* theme function or nested) in `SystemCssProperties`.
430+
* Map of all available CSS properties (including aliases and overwrites)
431+
* and their raw value.
433432
*/
434-
interface AllSystemCSSProperties
433+
export interface ThemeUIExtendedCSSProperties
435434
extends Omit<CSSProperties, keyof OverwriteCSSProperties>,
436435
AliasesCSSProperties,
437436
OverwriteCSSProperties {}
438437

439-
export type SystemCssProperties = {
440-
[K in keyof AllSystemCSSProperties]:
441-
| ResponsiveStyleValue<AllSystemCSSProperties[K]>
442-
| ((theme: any) => ResponsiveStyleValue<AllSystemCSSProperties[K]>)
443-
| SystemStyleObject
438+
export type ThemeUICSSProperties = {
439+
[K in keyof ThemeUIExtendedCSSProperties]:
440+
| ResponsiveStyleValue<ThemeUIExtendedCSSProperties[K]>
441+
| ((theme: Theme) => ResponsiveStyleValue<ThemeUIExtendedCSSProperties[K]>)
442+
| ThemeUIStyleObject
444443
}
445444

446445
export interface VariantProperty {
@@ -469,16 +468,16 @@ export interface VariantProperty {
469468
}
470469

471470
export interface UseThemeFunction {
472-
(theme: any): Exclude<SystemStyleObject, UseThemeFunction>
471+
(theme: any): Exclude<ThemeUIStyleObject, UseThemeFunction>
473472
}
474473

475474
/**
476-
* The `SystemStyleObject` extends [style props](https://emotion.sh/docs/object-styles)
475+
* The `ThemeUIStyleObject` extends [style props](https://emotion.sh/docs/object-styles)
477476
* such that properties that are part of the `Theme` will be transformed to
478477
* their corresponding values. Other valid CSS properties are also allowed.
479478
*/
480-
export type SystemStyleObject =
481-
| SystemCssProperties
479+
export type ThemeUIStyleObject =
480+
| ThemeUICSSProperties
482481
| CSSPseudoSelectorProps
483482
| CSSSelectorObject
484483
| VariantProperty
@@ -538,36 +537,36 @@ interface ColorModesScale extends ColorMode {
538537
}
539538

540539
interface ThemeStyles {
541-
tr?: SystemStyleObject
542-
th?: SystemStyleObject
543-
td?: SystemStyleObject
544-
em?: SystemStyleObject
545-
strong?: SystemStyleObject
546-
div?: SystemStyleObject
547-
p?: SystemStyleObject
548-
b?: SystemStyleObject
549-
i?: SystemStyleObject
550-
a?: SystemStyleObject
551-
h1?: SystemStyleObject
552-
h2?: SystemStyleObject
553-
h3?: SystemStyleObject
554-
h4?: SystemStyleObject
555-
h5?: SystemStyleObject
556-
h6?: SystemStyleObject
557-
img?: SystemStyleObject
558-
pre?: SystemStyleObject
559-
code?: SystemStyleObject
560-
ol?: SystemStyleObject
561-
ul?: SystemStyleObject
562-
li?: SystemStyleObject
563-
blockquote?: SystemStyleObject
564-
hr?: SystemStyleObject
565-
table?: SystemStyleObject
566-
delete?: SystemStyleObject
567-
inlineCode?: SystemStyleObject
568-
thematicBreak?: SystemStyleObject
569-
root?: SystemStyleObject
570-
[key: string]: SystemStyleObject
540+
tr?: ThemeUIStyleObject
541+
th?: ThemeUIStyleObject
542+
td?: ThemeUIStyleObject
543+
em?: ThemeUIStyleObject
544+
strong?: ThemeUIStyleObject
545+
div?: ThemeUIStyleObject
546+
p?: ThemeUIStyleObject
547+
b?: ThemeUIStyleObject
548+
i?: ThemeUIStyleObject
549+
a?: ThemeUIStyleObject
550+
h1?: ThemeUIStyleObject
551+
h2?: ThemeUIStyleObject
552+
h3?: ThemeUIStyleObject
553+
h4?: ThemeUIStyleObject
554+
h5?: ThemeUIStyleObject
555+
h6?: ThemeUIStyleObject
556+
img?: ThemeUIStyleObject
557+
pre?: ThemeUIStyleObject
558+
code?: ThemeUIStyleObject
559+
ol?: ThemeUIStyleObject
560+
ul?: ThemeUIStyleObject
561+
li?: ThemeUIStyleObject
562+
blockquote?: ThemeUIStyleObject
563+
hr?: ThemeUIStyleObject
564+
table?: ThemeUIStyleObject
565+
delete?: ThemeUIStyleObject
566+
inlineCode?: ThemeUIStyleObject
567+
thematicBreak?: ThemeUIStyleObject
568+
root?: ThemeUIStyleObject
569+
[key: string]: ThemeUIStyleObject
571570
}
572571

573572
export interface Theme {
@@ -586,10 +585,10 @@ export interface Theme {
586585
radii?: ObjectOrArray<CSS.BorderRadiusProperty<TLengthStyledSystem>>
587586
shadows?: ObjectOrArray<CSS.BoxShadowProperty>
588587
zIndices?: ObjectOrArray<CSS.ZIndexProperty>
589-
buttons?: ObjectOrArray<SystemCssProperties>
590-
colorStyles?: ObjectOrArray<SystemCssProperties>
591-
textStyles?: ObjectOrArray<SystemCssProperties>
592-
text?: ObjectOrArray<SystemCssProperties>
588+
buttons?: ObjectOrArray<ThemeUICSSProperties>
589+
colorStyles?: ObjectOrArray<ThemeUICSSProperties>
590+
textStyles?: ObjectOrArray<ThemeUICSSProperties>
591+
text?: ObjectOrArray<ThemeUICSSProperties>
593592
opacities?: ObjectOrArray<CSS.OpacityProperty>
594593
/**
595594
* Enable/disable custom CSS properties/variables if lower browser

0 commit comments

Comments
 (0)