@stitches/core
Advanced tools
Comparing version 1.0.0-canary.2 to 1.0.0-canary.3
{ | ||
"name": "@stitches/core", | ||
"version": "1.0.0-canary.2", | ||
"version": "1.0.0-canary.3", | ||
"description": "The modern CSS-in-JS library", | ||
@@ -79,4 +79,3 @@ "type": "module", | ||
"variables" | ||
], | ||
"gitHead": "f810d8569f43f81ea35ae9e4cd2d36df3e600de3" | ||
] | ||
} |
@@ -32,2 +32,5 @@ import type CreateStitches from './create-stitches' | ||
/** Returns the properties, attributes, and children expected by a component. */ | ||
export type ComponentProps<Component> = Parameters<Component>[0] | ||
/** Returns a type that expects a value to be a kind of CSS property value. */ | ||
@@ -34,0 +37,0 @@ export type PropertyValue<K extends keyof CSSUtil.CSSProperties> = { readonly [CSSUtil.$$PropertyValue]: K } |
@@ -133,7 +133,4 @@ import type * as CSSUtil from './css-util' | ||
StyledComponent.StyledComponentType<Composers>, | ||
StyledComponent.StyledComponentProps<Composers>, | ||
Media, | ||
Theme, | ||
ThemeMap, | ||
Utils | ||
StyledComponent.StyledComponentProps<Composers> & { css?: CSS }, | ||
Media | ||
> | ||
@@ -140,0 +137,0 @@ }, |
@@ -7,24 +7,10 @@ import type * as CSSUtil from './css-util' | ||
export interface CssComponent< | ||
TagName = 'span', | ||
Type = 'span', | ||
Props = {}, | ||
Media = Default.Media, | ||
Theme = {}, | ||
ThemeMap = Default.ThemeMap, | ||
Utils = {}, | ||
TransformedProps = TransformProps<Props, Media>, | ||
CSS = CSSUtil.CSS<Media, Theme, ThemeMap, Utils> | ||
Media = Default.Media | ||
> { | ||
< | ||
Props extends { | ||
css?: Props['css'] extends CSSUtil.CSS | ||
? Props['css'] | ||
: CSS | ||
} | ||
>( | ||
( | ||
props?: | ||
& Partial<TransformedProps> | ||
& Props | ||
& { | ||
css?: Props['css'] | ||
} | ||
& { | ||
[name in number | string]: any | ||
@@ -41,4 +27,4 @@ } | ||
[$$StyledComponentType]: TagName | ||
[$$StyledComponentProps]: Props | ||
[$$StyledComponentType]: Type | ||
[$$StyledComponentProps]: Omit<Props, 'css'> | ||
[$$StyledComponentMedia]: Media | ||
@@ -48,5 +34,12 @@ } | ||
export type TransformProps<Props, Media> = { | ||
[K in keyof Props]: Props[K] | { | ||
[KMedia in Util.Prefixed<'@', 'initial' | keyof Media>]?: Props[K] | ||
} | ||
[K in keyof Props]: | ||
K extends 'css' | ||
? Props['css'] extends CSSUtil.CSS | ||
? Props['css'] | ||
: CSSUtil.CSS | ||
: | ||
| Props[K] | ||
| { | ||
[KMedia in Util.Prefixed<'@', 'initial' | keyof Media>]?: Props[K] | ||
} | ||
} | ||
@@ -78,2 +71,4 @@ | ||
? T[0] | ||
: T[0] extends (props: any) => any | ||
? T[0] | ||
: T[0] extends { [$$StyledComponentType]: unknown } | ||
@@ -80,0 +75,0 @@ ? T[0][$$StyledComponentType] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
534104
10551