@emotion/styled
Advanced tools
Comparing version 11.0.0-next.7 to 11.0.0-next.8
# @emotion/styled | ||
## 11.0.0-next.8 | ||
### Major Changes | ||
- [`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b) [#1600](https://github.com/emotion-js/emotion/pull/1600) Thanks [@joltmode](https://github.com/joltmode)! - Reworked TypeScript definitions so it's easier to provide a type for Theme. Instead of creating custom instances (like before) you can augment builtin Theme interface like this: | ||
```ts | ||
declare module '@emotion/core' { | ||
export interface Theme { | ||
primaryColor: string | ||
secondaryColor: string | ||
} | ||
} | ||
``` | ||
### Patch Changes | ||
- Updated dependencies [[`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b), [`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b), [`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b), [`c643107`](https://github.com/emotion-js/emotion/commit/c6431074cf52a4bb64587c86ce5d42fe2d49230b)]: | ||
- babel-plugin-emotion@11.0.0-next.8 | ||
- @emotion/core@11.0.0-next.8 | ||
- @emotion/serialize@0.12.0-next.3 | ||
## 11.0.0-next.7 | ||
@@ -4,0 +26,0 @@ |
{ | ||
"name": "@emotion/styled", | ||
"version": "11.0.0-next.7", | ||
"version": "11.0.0-next.8", | ||
"description": "styled API for emotion", | ||
@@ -16,9 +16,9 @@ "main": "dist/styled.cjs.js", | ||
"@emotion/is-prop-valid": "0.9.0-next.1", | ||
"@emotion/serialize": "^0.11.15-next.2", | ||
"@emotion/serialize": "^0.12.0-next.3", | ||
"@emotion/utils": "0.11.2", | ||
"babel-plugin-emotion": "^11.0.0-next.6" | ||
"babel-plugin-emotion": "^11.0.0-next.8" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@emotion/core": "^11.0.0-next.7", | ||
"@emotion/core": "^11.0.0-next.8", | ||
"react": ">=16.8.0" | ||
@@ -33,3 +33,3 @@ }, | ||
"@babel/core": "^7.7.2", | ||
"@emotion/core": "^11.0.0-next.7", | ||
"@emotion/core": "^11.0.0-next.8", | ||
"dtslint": "^0.3.0", | ||
@@ -36,0 +36,0 @@ "react": "^16.11.0" |
@@ -17,3 +17,3 @@ // Definitions by: Junyoung Clare Jang <https://github.com/Ailrun> | ||
import { ComponentSelector, Interpolation } from '@emotion/serialize' | ||
import { PropsOf, DistributiveOmit } from '@emotion/core' | ||
import { PropsOf, DistributiveOmit, Theme } from '@emotion/core' | ||
@@ -23,4 +23,3 @@ export { | ||
CSSObject, | ||
FunctionInterpolation, | ||
ObjectInterpolation | ||
FunctionInterpolation | ||
} from '@emotion/serialize' | ||
@@ -78,3 +77,6 @@ | ||
Interpolation< | ||
ComponentProps & SpecificComponentProps & StyleProps & AdditionalProps | ||
ComponentProps & | ||
SpecificComponentProps & | ||
StyleProps & | ||
AdditionalProps & { theme: Theme } | ||
> | ||
@@ -90,3 +92,6 @@ > | ||
Interpolation< | ||
ComponentProps & SpecificComponentProps & AdditionalProps & StyleProps | ||
ComponentProps & | ||
SpecificComponentProps & | ||
StyleProps & | ||
AdditionalProps & { theme: Theme } | ||
> | ||
@@ -106,3 +111,3 @@ > | ||
*/ | ||
export interface CreateStyled<Theme extends {} = any> { | ||
export interface CreateStyled { | ||
< | ||
@@ -116,7 +121,3 @@ C extends React.ComponentType<React.ComponentProps<C>>, | ||
options: FilteringStyledOptions<PropsOf<C>, ForwardedProps> | ||
): CreateStyledComponent< | ||
Pick<PropsOf<C>, ForwardedProps> & { theme?: Theme }, | ||
{}, | ||
{ theme: Theme } | ||
> | ||
): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & { theme?: Theme }> | ||
@@ -126,3 +127,3 @@ <C extends React.ComponentType<React.ComponentProps<C>>>( | ||
options?: StyledOptions<PropsOf<C>> | ||
): CreateStyledComponent<PropsOf<C> & { theme?: Theme }, {}, { theme: Theme }> | ||
): CreateStyledComponent<PropsOf<C> & { theme?: Theme }> | ||
@@ -137,4 +138,3 @@ < | ||
{ theme?: Theme }, | ||
Pick<JSX.IntrinsicElements[Tag], ForwardedProps>, | ||
{ theme: Theme } | ||
Pick<JSX.IntrinsicElements[Tag], ForwardedProps> | ||
> | ||
@@ -145,7 +145,3 @@ | ||
options?: StyledOptions<JSX.IntrinsicElements[Tag]> | ||
): CreateStyledComponent< | ||
{ theme?: Theme }, | ||
JSX.IntrinsicElements[Tag], | ||
{ theme: Theme } | ||
> | ||
): CreateStyledComponent<{ theme?: Theme }, JSX.IntrinsicElements[Tag]> | ||
} | ||
@@ -152,0 +148,0 @@ |
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun> | ||
// TypeScript Version: 3.2 | ||
import { Theme } from '@emotion/core' | ||
import { CreateStyled as BaseCreateStyled, CreateStyledComponent } from './base' | ||
@@ -12,3 +13,2 @@ | ||
Interpolation, | ||
ObjectInterpolation, | ||
StyledComponent, | ||
@@ -19,15 +19,12 @@ StyledOptions, | ||
export type StyledTags<Theme extends {} = any> = { | ||
export type StyledTags = { | ||
[Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent< | ||
{ theme?: Theme }, | ||
JSX.IntrinsicElements[Tag], | ||
{ theme: Theme } | ||
JSX.IntrinsicElements[Tag] | ||
> | ||
} | ||
export interface CreateStyled<Theme extends {} = any> | ||
extends BaseCreateStyled<Theme>, | ||
StyledTags<Theme> {} | ||
export interface CreateStyled extends BaseCreateStyled, StyledTags {} | ||
declare const styled: CreateStyled | ||
export default styled |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
178375
1796
+ Added@emotion/hash@0.7.3(transitive)
+ Added@emotion/serialize@0.12.0-next.3(transitive)
+ Added@emotion/unitless@0.7.4(transitive)
- Removed@emotion/hash@0.8.0(transitive)
- Removed@emotion/memoize@0.7.4(transitive)
- Removed@emotion/serialize@0.11.16(transitive)
- Removed@emotion/unitless@0.7.5(transitive)
- Removed@emotion/utils@0.11.3(transitive)