diff --git a/packages/core/src/createStitches.js b/packages/core/src/createStitches.js index a23c7e04..187d4594 100644 --- a/packages/core/src/createStitches.js +++ b/packages/core/src/createStitches.js @@ -1,4 +1,3 @@ -import { defaultMedia } from './default/defaultMedia.js' import { defaultThemeMap } from './default/defaultThemeMap.js' import { createMemo } from './utility/createMemo.js' @@ -22,7 +21,7 @@ export const createStitches = (config) => { // internal configuration const prefix = 'prefix' in initConfig ? String(initConfig.prefix) : '' - const media = { ...defaultMedia, ...(typeof initConfig.media === 'object' && initConfig.media || {}) } + const media = typeof initConfig.media === 'object' && initConfig.media || {} const root = typeof initConfig.root === 'object' ? initConfig.root || null : globalThis.document || null const theme = typeof initConfig.theme === 'object' && initConfig.theme || {} const themeMap = typeof initConfig.themeMap === 'object' && initConfig.themeMap || { ...defaultThemeMap } diff --git a/packages/core/src/default/defaultMedia.js b/packages/core/src/default/defaultMedia.js deleted file mode 100644 index 67eff883..00000000 --- a/packages/core/src/default/defaultMedia.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {{ all: 'all' }} */ -export const defaultMedia = { - all: 'all', -} diff --git a/packages/core/types/default.d.ts b/packages/core/types/default.d.ts index 1092e2df..ae29bb35 100644 --- a/packages/core/types/default.d.ts +++ b/packages/core/types/default.d.ts @@ -5,7 +5,7 @@ export type Prefix = '' /** Default Media configuration. */ -export type Media = { all: string } +export type Media = {} /** Default Theme. */ export type Theme = { diff --git a/packages/core/types/styled-component.d.ts b/packages/core/types/styled-component.d.ts index a729754c..6c0751ff 100644 --- a/packages/core/types/styled-component.d.ts +++ b/packages/core/types/styled-component.d.ts @@ -6,11 +6,12 @@ import type * as Util from './util' export interface CssComponent< Type = 'span', Props = {}, - Media = Default.Media + Media = Default.Media, + TransformedProps = TransformProps, Media> & { css?: Props['css'] } > { ( props?: - & Props + & TransformedProps & { [name in number | string]: any } diff --git a/packages/react/types/default.d.ts b/packages/react/types/default.d.ts index 1092e2df..ae29bb35 100644 --- a/packages/react/types/default.d.ts +++ b/packages/react/types/default.d.ts @@ -5,7 +5,7 @@ export type Prefix = '' /** Default Media configuration. */ -export type Media = { all: string } +export type Media = {} /** Default Theme. */ export type Theme = { diff --git a/packages/react/types/styled-component.d.ts b/packages/react/types/styled-component.d.ts index 96efe97b..db775b3b 100644 --- a/packages/react/types/styled-component.d.ts +++ b/packages/react/types/styled-component.d.ts @@ -8,7 +8,7 @@ export interface StyledComponent< Type = 'span', Props = {}, Media = Default.Media, - TransformedProps = TransformProps + TransformedProps = TransformProps, Media> & { css?: Props['css'] } > extends React.ForwardRefExoticComponent< Util.Assign< Type extends React.ElementType @@ -40,7 +40,7 @@ export interface CssComponent< Type = 'span', Props = {}, Media = Default.Media, - TransformedProps = TransformProps + TransformedProps = TransformProps, Media> & { css?: Props['css'] } > { ( props?: @@ -64,18 +64,15 @@ export interface CssComponent< export type TransformProps = { [K in keyof Props]: - K extends 'css' - ? unknown - : - | Props[K] - | ( - & { - [KMedia in Util.Prefixed<'@', 'initial' | keyof Media>]?: Props[K] - } - & { - [KMedia in string]: Props[K] - } - ) + | Props[K] + | ( + & { + [KMedia in Util.Prefixed<'@', 'initial' | keyof Media>]?: Props[K] + } + & { + [KMedia in string]: Props[K] + } + ) } /** Unique symbol used to reference the type of a Styled Component. */