File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,13 +31,14 @@ export type DevupCommonProps = Merge<
3131 DevupShortcutsProps
3232>
3333
34- export interface DevupProps
35- extends DevupCommonProps ,
36- DevupSelectorProps ,
34+ export interface DevupProps extends DevupCommonProps , DevupSelectorProps { }
35+
36+ export interface DevupPropsWithTheme
37+ extends DevupProps ,
3738 DevupThemeSelectorProps { }
3839
3940export interface DevupComponentProps < T extends React . ElementType >
40- extends DevupProps {
41+ extends DevupPropsWithTheme {
4142 as ?: T
4243 styleVars ?: Record < string , string | undefined >
4344}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { Pseudos } from 'csstype'
22
33import type { ResponsiveValue } from '../../responsive-value'
44import type { DevupTheme } from '../../theme'
5- import type { DevupCommonProps } from '../index'
5+ import type { DevupProps } from '../index'
66
77type CamelCase < S extends string > =
88 S extends Lowercase < S >
@@ -13,18 +13,13 @@ type CamelCase<S extends string> =
1313
1414type PascalCase < S extends string > = Capitalize < CamelCase < S > >
1515
16+ type SelectorProps = ResponsiveValue < DevupProps | string | false >
1617export type DevupThemeSelectorProps = keyof DevupTheme extends undefined
17- ? Record < `_theme${string } `, DevupCommonProps & DevupSelectorProps >
18+ ? Record < `_theme${string } `, SelectorProps >
1819 : {
19- [ K in keyof DevupTheme as `_theme${PascalCase < K > } `] ?: DevupCommonProps &
20- DevupSelectorProps
20+ [ K in keyof DevupTheme as `_theme${PascalCase < K > } `] ?: SelectorProps
2121 }
2222
23- type SelectorProps = ResponsiveValue <
24- | ( DevupCommonProps & DevupSelectorProps & DevupThemeSelectorProps )
25- | string
26- | false
27- >
2823type NormalSelector = Exclude <
2924 Pseudos ,
3025 `:-${string } ` | `::-${string } ` | `${string } ()`
Original file line number Diff line number Diff line change 1- import type { DevupProps } from '../types/props'
1+ import type { DevupPropsWithTheme } from '../types/props'
22
3- export function css ( props : DevupProps ) : string
3+ export function css ( props : DevupPropsWithTheme ) : string
44export function css ( strings : TemplateStringsArray ) : string
55export function css ( ) : string
66
77export function css (
88 // eslint-disable-next-line @typescript-eslint/no-unused-vars
9- strings ?: TemplateStringsArray | DevupProps ,
9+ strings ?: TemplateStringsArray | DevupPropsWithTheme ,
1010) : string {
1111 throw new Error ( 'Cannot run on the runtime' )
1212}
You can’t perform that action at this time.
0 commit comments